home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: LIBCARD.TEX
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document, ASCII text
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| x-fmt/111 Plain Text File
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| text/x-matlab
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000010| 25 25 25 25 25 25 25 25 | 25 25 25 25 20 2d 2a 2d |%%%%%%%%|%%%% -*-|
|00000020| 20 4d 6f 64 65 3a 20 50 | 6c 61 69 6e 2d 54 65 78 | Mode: P|lain-Tex|
|00000030| 20 2d 2a 2d 20 25 25 25 | 25 25 25 25 25 25 25 25 | -*- %%%|%%%%%%%%|
|00000040| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 0a |%%%%%%%%|%%%%%%%.|
|00000050| 25 25 20 6c 69 62 2d 63 | 61 72 64 2e 74 65 78 20 |%% lib-c|ard.tex |
|00000060| 2d 2d 20 52 65 66 65 72 | 65 6e 63 65 20 43 61 72 |-- Refer|ence Car|
|00000070| 64 20 66 6f 72 20 41 74 | 61 72 69 20 53 54 20 47 |d for At|ari ST G|
|00000080| 4e 55 20 43 20 4c 69 62 | 72 61 72 79 20 46 75 6e |NU C Lib|rary Fun|
|00000090| 63 74 69 6f 6e 73 0a 25 | 25 20 20 20 20 20 20 20 |ctions.%|% |
|000000a0| 20 20 20 20 20 20 20 20 | 20 20 54 68 69 73 20 66 | | This f|
|000000b0| 69 6c 65 20 69 73 20 74 | 6f 20 62 65 20 70 72 6f |ile is t|o be pro|
|000000c0| 63 65 73 73 65 64 20 62 | 79 20 70 6c 61 69 6e 20 |cessed b|y plain |
|000000d0| 54 65 58 2e 0a 25 25 0a | 25 25 20 43 6f 70 79 72 |TeX..%%.|%% Copyr|
|000000e0| 69 67 68 74 20 28 43 29 | 20 31 39 39 30 2c 31 39 |ight (C)| 1990,19|
|000000f0| 39 31 20 20 20 20 20 20 | 46 72 61 6e 6b 20 52 69 |91 |Frank Ri|
|00000100| 64 64 65 72 62 75 73 63 | 68 0a 25 25 0a 25 25 20 |dderbusc|h.%%.%% |
|00000110| 54 68 69 73 20 74 65 78 | 74 20 69 73 20 66 72 65 |This tex|t is fre|
|00000120| 65 20 73 6f 66 74 77 61 | 72 65 3b 20 79 6f 75 20 |e softwa|re; you |
|00000130| 63 61 6e 20 72 65 64 69 | 73 74 72 69 62 75 74 65 |can redi|stribute|
|00000140| 20 69 74 20 61 6e 64 2f | 6f 72 20 6d 6f 64 69 66 | it and/|or modif|
|00000150| 79 0a 25 25 20 69 74 20 | 75 6e 64 65 72 20 74 68 |y.%% it |under th|
|00000160| 65 20 74 65 72 6d 73 20 | 6f 66 20 74 68 65 20 47 |e terms |of the G|
|00000170| 4e 55 20 47 65 6e 65 72 | 61 6c 20 50 75 62 6c 69 |NU Gener|al Publi|
|00000180| 63 20 4c 69 63 65 6e 73 | 65 20 61 73 20 70 75 62 |c Licens|e as pub|
|00000190| 6c 69 73 68 65 64 20 62 | 79 0a 25 25 20 74 68 65 |lished b|y.%% the|
|000001a0| 20 46 72 65 65 20 53 6f | 66 74 77 61 72 65 20 46 | Free So|ftware F|
|000001b0| 6f 75 6e 64 61 74 69 6f | 6e 3b 20 65 69 74 68 65 |oundatio|n; eithe|
|000001c0| 72 20 76 65 72 73 69 6f | 6e 20 31 2c 20 6f 72 20 |r versio|n 1, or |
|000001d0| 61 6e 79 20 6c 61 74 65 | 72 20 76 65 72 73 69 6f |any late|r versio|
|000001e0| 6e 2e 0a 25 25 20 0a 25 | 25 20 54 68 69 73 20 70 |n..%% .%|% This p|
|000001f0| 72 6f 67 72 61 6d 20 28 | 74 65 78 74 29 20 69 73 |rogram (|text) is|
|00000200| 20 64 69 73 74 72 69 62 | 75 74 65 64 20 69 6e 20 | distrib|uted in |
|00000210| 74 68 65 20 68 6f 70 65 | 20 74 68 61 74 20 69 74 |the hope| that it|
|00000220| 20 77 69 6c 6c 20 62 65 | 20 75 73 65 66 75 6c 2c | will be| useful,|
|00000230| 0a 25 25 20 62 75 74 20 | 57 49 54 48 4f 55 54 20 |.%% but |WITHOUT |
|00000240| 41 4e 59 20 57 41 52 52 | 41 4e 54 59 3b 20 77 69 |ANY WARR|ANTY; wi|
|00000250| 74 68 6f 75 74 20 65 76 | 65 6e 20 74 68 65 20 69 |thout ev|en the i|
|00000260| 6d 70 6c 69 65 64 20 77 | 61 72 72 61 6e 74 79 20 |mplied w|arranty |
|00000270| 6f 66 0a 25 25 20 4d 45 | 52 43 48 41 4e 54 41 42 |of.%% ME|RCHANTAB|
|00000280| 49 4c 49 54 59 20 6f 72 | 20 46 49 54 4e 45 53 53 |ILITY or| FITNESS|
|00000290| 20 46 4f 52 20 41 20 50 | 41 52 54 49 43 55 4c 41 | FOR A P|ARTICULA|
|000002a0| 52 20 50 55 52 50 4f 53 | 45 2e 20 20 53 65 65 20 |R PURPOS|E. See |
|000002b0| 74 68 65 0a 25 25 20 47 | 4e 55 20 47 65 6e 65 72 |the.%% G|NU Gener|
|000002c0| 61 6c 20 50 75 62 6c 69 | 63 20 4c 69 63 65 6e 73 |al Publi|c Licens|
|000002d0| 65 20 66 6f 72 20 6d 6f | 72 65 20 64 65 74 61 69 |e for mo|re detai|
|000002e0| 6c 73 2e 0a 25 25 20 0a | 25 25 20 41 64 64 69 74 |ls..%% .|%% Addit|
|000002f0| 69 6f 6e 61 6c 2c 20 49 | 20 64 65 63 6c 61 72 65 |ional, I| declare|
|00000300| 20 74 68 69 73 20 72 65 | 66 65 72 65 6e 63 65 20 | this re|ference |
|00000310| 63 61 72 64 20 70 6f 73 | 74 63 61 72 64 2d 77 61 |card pos|tcard-wa|
|00000320| 72 65 2e 20 49 66 20 79 | 6f 75 20 66 69 6e 64 0a |re. If y|ou find.|
|00000330| 25 25 20 74 68 69 73 20 | 72 65 66 65 72 65 6e 63 |%% this |referenc|
|00000340| 65 20 63 61 72 64 20 75 | 73 65 66 75 6c 2c 20 70 |e card u|seful, p|
|00000350| 6c 65 61 73 65 20 73 65 | 6e 64 20 61 20 73 69 6d |lease se|nd a sim|
|00000360| 70 6c 65 20 70 6f 73 74 | 63 61 72 64 20 74 6f 20 |ple post|card to |
|00000370| 74 68 65 0a 25 25 20 61 | 64 64 72 65 73 73 20 6d |the.%% a|ddress m|
|00000380| 65 6e 74 69 6f 6e 65 64 | 20 62 65 6c 6f 77 2e 0a |entioned| below..|
|00000390| 25 25 0a 25 25 20 41 75 | 74 68 6f 72 20 20 20 20 |%%.%% Au|thor |
|000003a0| 20 20 20 20 20 20 3a 20 | 46 72 61 6e 6b 20 52 69 | : |Frank Ri|
|000003b0| 64 64 65 72 62 75 73 63 | 68 0a 25 25 20 43 72 65 |dderbusc|h.%% Cre|
|000003c0| 61 74 65 64 20 4f 6e 20 | 20 20 20 20 20 3a 20 4d |ated On | : M|
|000003d0| 6f 6e 20 4d 61 72 20 31 | 32 20 31 30 3a 35 35 3a |on Mar 1|2 10:55:|
|000003e0| 33 38 20 31 39 39 30 0a | 25 25 20 4c 61 73 74 20 |38 1990.|%% Last |
|000003f0| 4d 6f 64 69 66 69 65 64 | 20 42 79 3a 20 46 72 61 |Modified| By: Fra|
|00000400| 6e 6b 20 52 69 64 64 65 | 72 62 75 73 63 68 0a 25 |nk Ridde|rbusch.%|
|00000410| 25 20 4c 61 73 74 20 4d | 6f 64 69 66 69 65 64 20 |% Last M|odified |
|00000420| 4f 6e 3a 20 54 68 75 20 | 4e 6f 76 20 32 35 20 32 |On: Thu |Nov 25 2|
|00000430| 32 3a 34 30 3a 35 32 20 | 31 39 39 33 0a 25 25 20 |2:40:52 |1993.%% |
|00000440| 55 70 64 61 74 65 20 43 | 6f 75 6e 74 20 20 20 20 |Update C|ount |
|00000450| 3a 20 31 32 39 0a 25 25 | 20 53 74 61 74 75 73 20 |: 129.%%| Status |
|00000460| 20 20 20 20 20 20 20 20 | 20 3a 20 52 65 6c 65 61 | | : Relea|
|00000470| 73 65 64 2e 0a 25 25 20 | 43 4f 4d 4d 45 4e 54 53 |sed..%% |COMMENTS|
|00000480| 0a 25 25 20 20 20 20 54 | 68 65 20 6d 61 74 68 65 |.%% T|he mathe|
|00000490| 6d 61 74 69 63 61 6c 20 | 66 75 6e 63 74 69 6f 6e |matical |function|
|000004a0| 20 73 65 63 74 69 6f 6e | 20 63 6f 75 6c 64 20 74 | section| could t|
|000004b0| 61 6b 65 20 73 6f 6d 65 | 20 61 64 64 69 74 69 6f |ake some| additio|
|000004c0| 6e 61 6c 0a 25 25 20 20 | 20 20 65 78 70 6c 61 6e |nal.%% | explan|
|000004d0| 61 74 69 6f 6e 73 2c 20 | 62 75 74 20 74 68 65 6e |ations, |but then|
|000004e0| 20 49 27 6d 20 61 66 72 | 61 69 64 20 49 27 76 65 | I'm afr|aid I've|
|000004f0| 20 74 6f 20 66 69 6c 6c | 20 61 6e 6f 74 68 65 72 | to fill| another|
|00000500| 20 63 6f 6d 70 6c 65 74 | 65 0a 25 25 20 20 20 20 | complet|e.%% |
|00000510| 70 61 67 65 20 28 31 32 | 20 70 61 67 65 73 20 61 |page (12| pages a|
|00000520| 6b 61 20 32 34 20 63 6f | 6c 75 6d 6e 73 20 69 73 |ka 24 co|lumns is|
|00000530| 20 71 75 69 74 65 20 65 | 6e 6f 75 67 68 29 2e 20 | quite e|nough). |
|00000540| 41 6c 73 6f 20 73 6f 6d | 65 0a 25 25 20 20 20 20 |Also som|e.%% |
|00000550| 66 75 6e 63 74 69 6f 6e | 73 20 69 6e 20 74 68 65 |function|s in the|
|00000560| 20 73 69 67 6e 61 6c 73 | 20 73 65 63 74 69 6f 6e | signals| section|
|00000570| 20 61 72 65 20 6d 69 73 | 73 69 6e 67 20 61 20 65 | are mis|sing a e|
|00000580| 78 70 6c 61 6e 61 74 69 | 6f 6e 2e 20 54 68 65 0a |xplanati|on. The.|
|00000590| 25 25 20 20 20 20 6d 6f | 74 69 76 61 74 69 6f 6e |%% mo|tivation|
|000005a0| 20 62 65 68 69 6e 64 20 | 74 68 69 73 20 72 6f 75 | behind |this rou|
|000005b0| 74 69 6e 65 73 20 69 73 | 20 6e 6f 74 20 31 30 30 |tines is| not 100|
|000005c0| 25 20 63 6c 65 61 72 20 | 74 6f 20 6d 65 2e 20 46 |% clear |to me. F|
|000005d0| 6f 72 0a 25 25 20 20 20 | 20 61 64 64 69 74 69 6f |or.%% | additio|
|000005e0| 6e 61 6c 20 68 69 6e 74 | 73 20 61 62 6f 75 74 20 |nal hint|s about |
|000005f0| 74 68 69 73 20 6d 75 6c | 74 69 63 6f 6c 75 6d 6e |this mul|ticolumn|
|00000600| 20 66 6f 72 6d 61 74 20 | 73 65 65 20 74 68 65 20 | format |see the |
|00000610| 63 6f 6d 6d 65 6e 74 20 | 69 6e 0a 25 25 20 20 20 |comment |in.%% |
|00000620| 20 74 68 65 20 66 69 6c | 65 20 76 61 72 6d 61 63 | the fil|e varmac|
|00000630| 72 6f 2e 74 65 78 2e 0a | 25 25 20 48 49 53 54 4f |ro.tex..|%% HISTO|
|00000640| 52 59 20 0a 25 25 20 31 | 38 2d 4d 61 79 2d 31 39 |RY .%% 1|8-May-19|
|00000650| 39 31 20 20 20 20 20 20 | 20 20 20 20 46 72 61 6e |91 | Fran|
|00000660| 6b 20 52 69 64 64 65 72 | 62 75 73 63 68 20 20 20 |k Ridder|busch |
|00000670| 20 20 20 20 0a 25 25 20 | 20 20 20 4c 61 73 74 20 | .%% | Last |
|00000680| 4d 6f 64 69 66 69 65 64 | 3a 20 53 61 74 20 4d 61 |Modified|: Sat Ma|
|00000690| 79 20 31 38 20 31 33 3a | 30 39 3a 32 32 20 31 39 |y 18 13:|09:22 19|
|000006a0| 39 31 20 23 31 31 30 20 | 28 6e 69 6c 29 0a 25 25 |91 #110 |(nil).%%|
|000006b0| 20 20 20 20 55 70 64 61 | 74 65 64 20 74 6f 20 6d | Upda|ted to m|
|000006c0| 61 74 63 68 20 4a 2e 52 | 2e 42 61 6d 6d 69 27 73 |atch J.R|.Bammi's|
|000006d0| 20 72 65 63 65 6e 74 20 | 73 65 6e 74 20 64 69 66 | recent |sent dif|
|000006e0| 66 73 2e 20 49 6e 63 6c | 75 73 69 6f 6e 20 6f 66 |fs. Incl|usion of|
|000006f0| 0a 25 25 20 20 20 20 4d | 69 4e 54 20 61 6e 64 20 |.%% M|iNT and |
|00000700| 54 54 20 73 74 75 66 66 | 2e 20 28 4c 69 62 72 61 |TT stuff|. (Libra|
|00000710| 72 69 65 73 20 61 6e 64 | 20 68 65 61 64 65 72 73 |ries and| headers|
|00000720| 20 61 74 20 70 61 74 63 | 68 6c 65 76 65 6c 20 36 | at patc|hlevel 6|
|00000730| 35 29 0a 25 25 20 32 2d | 4d 61 79 2d 31 39 39 31 |5).%% 2-|May-1991|
|00000740| 20 20 20 20 20 20 20 20 | 20 20 20 46 72 61 6e 6b | | Frank|
|00000750| 20 52 69 64 64 65 72 62 | 75 73 63 68 20 54 33 35 | Ridderb|usch T35|
|00000760| 20 20 20 0a 25 25 20 20 | 20 20 4e 6f 77 20 75 73 | .%% | Now us|
|00000770| 65 73 20 76 61 72 6d 61 | 63 72 6f 2e 74 65 78 20 |es varma|cro.tex |
|00000780| 66 6f 72 20 61 6c 6c 20 | 6d 61 63 72 6f 73 2e 20 |for all |macros. |
|00000790| 44 65 66 69 6e 69 74 69 | 6f 6e 73 20 66 72 6f 6d |Definiti|ons from|
|000007a0| 20 74 68 69 73 20 66 69 | 6c 65 0a 25 25 20 20 20 | this fi|le.%% |
|000007b0| 20 68 61 76 65 20 62 65 | 65 6e 20 6d 6f 76 65 64 | have be|en moved|
|000007c0| 20 74 6f 20 74 68 61 74 | 20 66 69 6c 65 2e 20 4e | to that| file. N|
|000007d0| 6f 77 20 75 73 69 6e 67 | 20 5c 66 75 6e 63 74 69 |ow using| \functi|
|000007e0| 6f 6e 20 69 6e 73 74 65 | 61 64 20 6f 66 0a 25 25 |on inste|ad of.%%|
|000007f0| 20 20 20 20 5c 66 75 6e | 63 20 61 6e 64 20 5c 6c | \fun|c and \l|
|00000800| 66 75 6e 63 2e 0a 25 25 | 20 31 36 2d 4e 6f 76 2d |func..%%| 16-Nov-|
|00000810| 31 39 39 30 20 20 20 20 | 20 20 20 20 20 20 46 72 |1990 | Fr|
|00000820| 61 6e 6b 20 52 69 64 64 | 65 72 62 75 73 63 68 0a |ank Ridd|erbusch.|
|00000830| 25 25 20 20 20 20 47 6f | 74 20 33 20 63 6f 6c 75 |%% Go|t 3 colu|
|00000840| 6d 6e 73 20 66 6f 72 6d | 61 74 20 77 6f 72 6b 69 |mns form|at worki|
|00000850| 6e 67 20 61 6e 64 20 6e | 65 77 20 69 6e 63 6c 75 |ng and n|ew inclu|
|00000860| 64 65 20 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 0a |de prese|ntation.|
|00000870| 25 25 20 20 32 2d 4d 61 | 79 2d 31 39 39 30 20 20 |%% 2-Ma|y-1990 |
|00000880| 20 20 20 20 20 20 20 20 | 46 72 61 6e 6b 20 52 69 | |Frank Ri|
|00000890| 64 64 65 72 62 75 73 63 | 68 0a 25 25 20 20 20 20 |dderbusc|h.%% |
|000008a0| 46 69 64 64 6c 69 6e 67 | 20 77 69 74 68 20 74 68 |Fiddling| with th|
|000008b0| 65 20 66 6f 72 6d 61 74 | 20 61 6e 64 20 69 6e 73 |e format| and ins|
|000008c0| 65 72 74 61 74 69 6f 6e | 20 6f 66 20 73 79 73 76 |ertation| of sysv|
|000008d0| 61 72 73 0a 25 25 20 20 | 31 2d 4d 61 79 2d 31 39 |ars.%% |1-May-19|
|000008e0| 39 30 20 20 20 20 20 20 | 20 20 20 20 46 72 61 6e |90 | Fran|
|000008f0| 6b 20 52 69 64 64 65 72 | 62 75 73 63 68 0a 25 25 |k Ridder|busch.%%|
|00000900| 20 20 20 20 49 6e 73 65 | 72 74 69 6e 67 20 72 65 | Inse|rting re|
|00000910| 6d 61 72 6b 73 20 61 62 | 6f 75 74 20 66 67 65 74 |marks ab|out fget|
|00000920| 73 20 61 6e 64 20 67 65 | 74 73 20 63 6f 6e 63 65 |s and ge|ts conce|
|00000930| 72 6e 69 6e 67 20 74 68 | 65 20 4e 4c 20 63 68 61 |rning th|e NL cha|
|00000940| 72 61 63 74 65 72 2e 0a | 25 25 20 32 39 2d 41 70 |racter..|%% 29-Ap|
|00000950| 72 2d 31 39 39 30 20 20 | 20 20 20 20 20 20 20 20 |r-1990 | |
|00000960| 46 72 61 6e 6b 20 52 69 | 64 64 65 72 62 75 73 63 |Frank Ri|dderbusc|
|00000970| 68 0a 25 25 20 20 20 20 | 49 6e 63 6c 75 64 69 6e |h.%% |Includin|
|00000980| 67 20 74 68 65 20 76 74 | 35 32 20 65 73 63 61 70 |g the vt|52 escap|
|00000990| 65 20 73 65 71 75 65 6e | 63 65 73 0a 25 25 20 32 |e sequen|ces.%% 2|
|000009a0| 34 2d 41 70 72 2d 31 39 | 39 30 20 20 20 20 20 20 |4-Apr-19|90 |
|000009b0| 20 20 20 20 4a 77 61 68 | 61 72 20 52 2e 20 42 61 | Jwah|ar R. Ba|
|000009c0| 6d 6d 69 0a 25 25 20 20 | 20 20 43 6f 72 72 65 63 |mmi.%% | Correc|
|000009d0| 74 69 6f 6e 73 20 26 20 | 61 64 64 69 74 69 6f 6e |tions & |addition|
|000009e0| 61 6c 20 66 75 6e 63 74 | 69 6f 6e 73 20 28 6c 69 |al funct|ions (li|
|000009f0| 6e 65 61 2c 20 6c 73 74 | 61 74 2c 20 70 72 6f 66 |nea, lst|at, prof|
|00000a00| 69 6c 69 6e 67 2c 20 65 | 74 63 29 0a 25 25 20 31 |iling, e|tc).%% 1|
|00000a10| 31 2d 4d 61 72 2d 31 39 | 39 30 20 20 20 20 20 20 |1-Mar-19|90 |
|00000a20| 20 20 20 20 46 72 61 6e | 6b 20 52 69 64 64 65 72 | Fran|k Ridder|
|00000a30| 62 75 73 63 68 0a 25 25 | 20 20 20 20 53 74 61 72 |busch.%%| Star|
|00000a40| 74 69 6e 67 20 70 6f 69 | 6e 74 2e 20 43 72 65 61 |ting poi|nt. Crea|
|00000a50| 74 69 6e 67 20 6d 61 63 | 72 6f 73 20 5c 66 75 6e |ting mac|ros \fun|
|00000a60| 63 2e 20 5c 6c 66 75 6e | 63 20 61 6e 64 20 5c 65 |c. \lfun|c and \e|
|00000a70| 78 70 6c 2e 0a 25 25 0a | 25 25 20 20 20 20 50 6c |xpl..%%.|%% Pl|
|00000a80| 65 61 73 65 20 73 65 6e | 64 20 61 6e 79 20 63 6f |ease sen|d any co|
|00000a90| 6d 6d 65 6e 74 73 20 61 | 62 6f 75 74 20 6d 69 73 |mments a|bout mis|
|00000aa0| 73 69 6e 67 20 66 65 61 | 74 75 72 65 73 20 6f 72 |sing fea|tures or|
|00000ab0| 20 74 68 69 6e 67 73 20 | 74 6f 0a 25 25 20 20 20 | things |to.%% |
|00000ac0| 20 69 6e 63 6c 75 64 65 | 20 74 6f 3a 0a 25 25 20 | include| to:.%% |
|00000ad0| 20 20 20 45 6d 61 69 6c | 3a 0a 25 25 20 20 20 20 | Email|:.%% |
|00000ae0| 20 20 72 69 64 64 65 72 | 62 75 73 63 68 2e 70 61 | ridder|busch.pa|
|00000af0| 64 40 73 6e 69 2d 75 73 | 61 2e 63 6f 6d 20 20 20 |d@sni-us|a.com |
|00000b00| 28 41 6d 65 72 69 63 61 | 20 28 4e 6f 72 74 68 20 |(America| (North |
|00000b10| 26 20 53 6f 75 74 68 29 | 29 0a 25 25 20 20 20 20 |& South)|).%% |
|00000b20| 20 20 72 69 64 64 65 72 | 62 75 73 63 68 2e 70 61 | ridder|busch.pa|
|00000b30| 64 40 73 6e 69 2e 64 65 | 20 20 20 20 20 20 20 20 |d@sni.de| |
|00000b40| 28 52 65 73 74 20 6f 66 | 20 57 6f 72 6c 64 29 0a |(Rest of| World).|
|00000b50| 25 25 20 20 20 20 20 20 | 46 72 61 6e 6b 5f 52 69 |%% |Frank_Ri|
|00000b60| 64 64 65 72 62 75 73 63 | 68 40 70 62 32 2e 6d 61 |dderbusc|h@pb2.ma|
|00000b70| 75 73 2e 64 65 20 28 4d | 61 75 73 4e 65 74 29 0a |us.de (M|ausNet).|
|00000b80| 25 25 0a 25 25 20 20 20 | 20 53 6e 61 69 6c 3a 0a |%%.%% | Snail:.|
|00000b90| 25 25 20 20 20 20 20 20 | 46 72 61 6e 6b 20 52 69 |%% |Frank Ri|
|00000ba0| 64 64 65 72 62 75 73 63 | 68 20 20 20 20 20 20 20 |dderbusc|h |
|00000bb0| 54 65 6c 2e 3a 20 28 30 | 34 39 29 2d 35 32 35 34 |Tel.: (0|49)-5254|
|00000bc0| 20 36 37 30 36 36 0a 25 | 25 20 20 20 20 20 20 53 | 67066.%|% S|
|00000bd0| 61 6e 64 65 72 20 53 74 | 72 2e 20 31 37 0a 25 25 |ander St|r. 17.%%|
|00000be0| 20 20 20 20 20 20 33 33 | 31 30 36 20 50 61 64 65 | 33|106 Pade|
|00000bf0| 72 62 6f 72 6e 0a 25 25 | 20 20 20 20 20 20 47 65 |rborn.%%| Ge|
|00000c00| 72 6d 61 6e 79 0a 25 25 | 25 25 25 25 25 25 25 25 |rmany.%%|%%%%%%%%|
|00000c10| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000c20| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000c30| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000c40| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000c50| 25 25 25 25 25 0a 0a 25 | 20 52 65 66 65 72 65 6e |%%%%%..%| Referen|
|00000c60| 63 65 20 43 61 72 64 20 | 66 6f 72 20 47 4e 55 20 |ce Card |for GNU |
|00000c70| 43 20 4c 69 62 72 61 72 | 79 20 6f 6e 20 74 68 65 |C Librar|y on the|
|00000c80| 20 41 74 61 72 69 20 53 | 54 0a 25 2a 2a 73 74 61 | Atari S|T.%**sta|
|00000c90| 72 74 20 6f 66 20 68 65 | 61 64 65 72 0a 5c 6e 65 |rt of he|ader.\ne|
|00000ca0| 77 63 6f 75 6e 74 5c 63 | 6f 6c 75 6d 6e 73 70 65 |wcount\c|olumnspe|
|00000cb0| 72 70 61 67 65 0a 0a 25 | 20 54 68 69 73 20 66 69 |rpage..%| This fi|
|00000cc0| 6c 65 20 63 61 6e 20 62 | 65 20 70 72 69 6e 74 65 |le can b|e printe|
|00000cd0| 64 20 77 69 74 68 20 31 | 2c 20 32 2c 20 6f 72 20 |d with 1|, 2, or |
|00000ce0| 33 20 63 6f 6c 75 6d 6e | 73 20 70 65 72 20 70 61 |3 column|s per pa|
|00000cf0| 67 65 20 28 73 65 65 20 | 62 65 6c 6f 77 29 2e 0a |ge (see |below)..|
|00000d00| 25 20 53 70 65 63 69 66 | 79 20 68 6f 77 20 6d 61 |% Specif|y how ma|
|00000d10| 6e 79 20 79 6f 75 20 77 | 61 6e 74 20 68 65 72 65 |ny you w|ant here|
|00000d20| 2e 20 20 4e 6f 74 68 69 | 6e 67 20 65 6c 73 65 20 |. Nothi|ng else |
|00000d30| 6e 65 65 64 73 20 74 6f | 20 62 65 20 63 68 61 6e |needs to| be chan|
|00000d40| 67 65 64 2e 0a 0a 5c 63 | 6f 6c 75 6d 6e 73 70 65 |ged...\c|olumnspe|
|00000d50| 72 70 61 67 65 3d 32 0a | 0a 5c 64 65 66 5c 76 65 |rpage=2.|.\def\ve|
|00000d60| 72 73 69 6f 6e 6e 75 6d | 62 65 72 7b 32 2e 31 70 |rsionnum|ber{2.1p|
|00000d70| 72 65 7d 0a 5c 64 65 66 | 5c 79 65 61 72 7b 31 39 |re}.\def|\year{19|
|00000d80| 39 32 7d 0a 5c 64 65 66 | 5c 76 65 72 73 69 6f 6e |92}.\def|\version|
|00000d90| 7b 41 75 67 2e 20 5c 79 | 65 61 72 5c 20 76 5c 76 |{Aug. \y|ear\ v\v|
|00000da0| 65 72 73 69 6f 6e 6e 75 | 6d 62 65 72 7d 0a 0a 5c |ersionnu|mber}..\|
|00000db0| 64 65 66 5c 73 68 6f 72 | 74 63 6f 70 79 72 69 67 |def\shor|tcopyrig|
|00000dc0| 68 74 6e 6f 74 69 63 65 | 7b 5c 76 73 6b 69 70 20 |htnotice|{\vskip |
|00000dd0| 31 65 78 20 70 6c 75 73 | 20 32 20 66 69 6c 6c 0a |1ex plus| 2 fill.|
|00000de0| 20 20 5c 63 65 6e 74 65 | 72 6c 69 6e 65 7b 5c 73 | \cente|rline{\s|
|00000df0| 6d 61 6c 6c 20 5c 63 6f | 70 79 72 69 67 68 74 5c |mall \co|pyright\|
|00000e00| 20 5c 79 65 61 72 5c 20 | 46 72 61 6e 6b 20 52 69 | \year\ |Frank Ri|
|00000e10| 64 64 65 72 62 75 73 63 | 68 0a 20 20 50 65 72 6d |dderbusc|h. Perm|
|00000e20| 69 73 73 69 6f 6e 73 20 | 6f 6e 20 62 61 63 6b 2e |issions |on back.|
|00000e30| 20 20 76 5c 76 65 72 73 | 69 6f 6e 6e 75 6d 62 65 | v\vers|ionnumbe|
|00000e40| 72 7d 7d 0a 0a 5c 64 65 | 66 5c 63 6f 70 79 72 69 |r}}..\de|f\copyri|
|00000e50| 67 68 74 6e 6f 74 69 63 | 65 7b 0a 5c 76 73 6b 69 |ghtnotic|e{.\vski|
|00000e60| 70 20 31 65 78 20 70 6c | 75 73 20 32 20 66 69 6c |p 1ex pl|us 2 fil|
|00000e70| 6c 5c 62 65 67 69 6e 67 | 72 6f 75 70 5c 73 6d 61 |l\beging|roup\sma|
|00000e80| 6c 6c 0a 5c 63 65 6e 74 | 65 72 6c 69 6e 65 7b 43 |ll.\cent|erline{C|
|00000e90| 6f 70 79 72 69 67 68 74 | 20 5c 63 6f 70 79 72 69 |opyright| \copyri|
|00000ea0| 67 68 74 5c 20 5c 79 65 | 61 72 5c 20 46 72 61 6e |ght\ \ye|ar\ Fran|
|00000eb0| 6b 20 52 69 64 64 65 72 | 62 75 73 63 68 7d 0a 5c |k Ridder|busch}.\|
|00000ec0| 63 65 6e 74 65 72 6c 69 | 6e 65 7b 54 68 69 73 20 |centerli|ne{This |
|00000ed0| 6d 75 6c 74 69 63 6f 6c | 75 6d 6e 20 66 6f 72 6d |multicol|umn form|
|00000ee0| 61 74 20 77 61 73 20 6f | 72 69 67 69 6e 61 6c 6c |at was o|riginall|
|00000ef0| 79 20 64 65 73 69 67 6e | 65 64 7d 0a 5c 63 65 6e |y design|ed}.\cen|
|00000f00| 74 65 72 6c 69 6e 65 7b | 62 79 20 53 74 65 70 68 |terline{|by Steph|
|00000f10| 65 6e 20 47 69 6c 64 65 | 61 20 61 6e 64 20 6d 6f |en Gilde|a and mo|
|00000f20| 64 69 66 69 65 64 20 74 | 6f 20 66 69 74 20 74 68 |dified t|o fit th|
|00000f30| 65 20 41 74 61 72 69 20 | 53 54 7d 0a 5c 63 65 6e |e Atari |ST}.\cen|
|00000f40| 74 65 72 6c 69 6e 65 7b | 6c 69 62 72 61 72 79 20 |terline{|library |
|00000f50| 66 75 6e 63 74 69 6f 6e | 73 20 62 79 20 46 72 61 |function|s by Fra|
|00000f60| 6e 6b 20 52 69 64 64 65 | 72 62 75 73 63 68 7d 0a |nk Ridde|rbusch}.|
|00000f70| 0a 50 65 72 6d 69 73 73 | 69 6f 6e 20 69 73 20 67 |.Permiss|ion is g|
|00000f80| 72 61 6e 74 65 64 20 74 | 6f 20 6d 61 6b 65 20 61 |ranted t|o make a|
|00000f90| 6e 64 20 64 69 73 74 72 | 69 62 75 74 65 20 63 6f |nd distr|ibute co|
|00000fa0| 70 69 65 73 20 6f 66 0a | 74 68 69 73 20 63 61 72 |pies of.|this car|
|00000fb0| 64 20 70 72 6f 76 69 64 | 65 64 20 74 68 65 20 63 |d provid|ed the c|
|00000fc0| 6f 70 79 72 69 67 68 74 | 20 6e 6f 74 69 63 65 20 |opyright| notice |
|00000fd0| 61 6e 64 20 74 68 69 73 | 20 70 65 72 6d 69 73 73 |and this| permiss|
|00000fe0| 69 6f 6e 20 6e 6f 74 69 | 63 65 0a 61 72 65 20 70 |ion noti|ce.are p|
|00000ff0| 72 65 73 65 72 76 65 64 | 20 6f 6e 20 61 6c 6c 20 |reserved| on all |
|00001000| 63 6f 70 69 65 73 2e 0a | 0a 5c 65 6e 64 67 72 6f |copies..|.\endgro|
|00001010| 75 70 7d 0a 0a 5c 69 6e | 70 75 74 20 76 61 72 6d |up}..\in|put varm|
|00001020| 61 63 72 6f 0a 0a 5c 6f | 76 65 72 66 75 6c 6c 72 |acro..\o|verfullr|
|00001030| 75 6c 65 3d 30 70 74 20 | 25 20 61 76 6f 69 64 20 |ule=0pt |% avoid |
|00001040| 75 67 6c 79 20 62 6c 61 | 63 6b 20 62 6f 78 65 73 |ugly bla|ck boxes|
|00001050| 0a 0a 25 2a 2a 65 6e 64 | 20 6f 66 20 68 65 61 64 |..%**end| of head|
|00001060| 65 72 0a 0c 0a 5c 74 69 | 74 6c 65 7b 54 6f 73 2d |er...\ti|tle{Tos-|
|00001070| 2d 47 4e 55 20 43 20 4c | 69 62 72 61 72 79 20 46 |-GNU C L|ibrary F|
|00001080| 75 6e 63 74 69 6f 6e 73 | 7d 0a 0a 54 68 69 73 20 |unctions|}..This |
|00001090| 72 65 66 65 72 65 6e 63 | 65 20 63 61 72 64 20 64 |referenc|e card d|
|000010a0| 65 73 63 72 69 62 65 73 | 20 74 68 65 20 61 76 61 |escribes| the ava|
|000010b0| 69 6c 61 62 6c 65 20 6c | 69 62 72 61 72 79 20 66 |ilable l|ibrary f|
|000010c0| 75 6e 63 74 69 6f 6e 73 | 20 6f 66 20 47 4e 55 20 |unctions| of GNU |
|000010d0| 43 0a 6f 6e 20 74 68 65 | 20 41 74 61 72 69 20 53 |C.on the| Atari S|
|000010e0| 54 20 61 6e 64 20 69 73 | 20 63 75 72 72 65 6e 74 |T and is| current|
|000010f0| 6c 79 20 62 61 73 65 64 | 20 6f 6e 20 74 68 65 20 |ly based| on the |
|00001100| 6c 69 62 72 61 72 79 20 | 66 72 6f 6d 0a 4a 77 61 |library |from.Jwa|
|00001110| 68 61 72 7e 52 2e 20 42 | 61 6d 6d 69 20 61 74 20 |har~R. B|ammi at |
|00001120| 70 61 74 63 68 6c 65 76 | 65 6c 20 38 33 2e 20 46 |patchlev|el 83. F|
|00001130| 6f 72 20 74 68 65 20 6d | 6f 73 74 20 70 61 72 74 |or the m|ost part|
|00001140| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 73 0a 61 | the fun|ctions.a|
|00001150| 72 65 20 61 6c 70 68 61 | 62 65 74 69 63 61 6c 6c |re alpha|beticall|
|00001160| 79 20 73 6f 72 74 65 64 | 20 62 79 20 66 75 6e 63 |y sorted| by func|
|00001170| 74 69 6f 6e 20 6e 61 6d | 65 2e 0a 0a 53 6f 6d 65 |tion nam|e...Some|
|00001180| 20 6f 66 20 74 68 65 20 | 6d 65 6e 74 69 6f 6e 65 | of the |mentione|
|00001190| 64 20 66 75 6e 63 74 69 | 6f 6e 73 20 61 72 65 20 |d functi|ons are |
|000011a0| 6f 6e 6c 79 20 61 76 61 | 69 6c 61 62 6c 65 2c 20 |only ava|ilable, |
|000011b0| 77 68 65 6e 20 4d 69 4e | 54 2c 20 74 68 65 20 54 |when MiN|T, the T|
|000011c0| 4f 53 0a 6d 75 6c 74 69 | 74 61 73 6b 69 6e 67 20 |OS.multi|tasking |
|000011d0| 65 78 74 65 6e 73 69 6f | 6e 20 66 72 6f 6d 20 45 |extensio|n from E|
|000011e0| 72 69 63 7e 52 2e 20 53 | 6d 69 74 68 20 69 73 20 |ric~R. S|mith is |
|000011f0| 72 75 6e 6e 69 6e 67 2c | 20 6f 72 20 69 66 20 79 |running,| or if y|
|00001200| 6f 75 0a 68 61 76 65 20 | 61 20 54 54 5c 6e 75 6c |ou.have |a TT\nul|
|00001210| 6c 2e 20 20 54 68 65 20 | 65 61 72 6c 69 65 72 20 |l. The |earlier |
|00001220| 61 72 65 20 6d 61 72 6b | 65 64 20 77 69 74 68 20 |are mark|ed with |
|00001230| 60 60 28 4d 69 4e 54 29 | 27 27 2c 20 74 68 65 20 |``(MiNT)|'', the |
|00001240| 6c 61 74 74 65 72 20 77 | 69 74 68 0a 60 60 28 54 |latter w|ith.``(T|
|00001250| 54 29 27 27 2e 5c 70 61 | 72 0a 5c 6d 65 64 73 6b |T)''.\pa|r.\medsk|
|00001260| 69 70 0a 5c 72 65 77 72 | 69 74 65 74 6f 63 66 69 |ip.\rewr|itetocfi|
|00001270| 6c 65 66 61 6c 73 65 0a | 5c 72 65 61 64 74 6f 63 |lefalse.|\readtoc|
|00001280| 66 69 6c 65 0a 5c 6d 65 | 64 73 6b 69 70 0a 41 64 |file.\me|dskip.Ad|
|00001290| 64 69 74 69 6f 6e 61 6c | 6c 79 2c 20 74 68 69 73 |ditional|ly, this|
|000012a0| 20 72 65 66 65 72 65 6e | 63 65 20 63 61 72 64 20 | referen|ce card |
|000012b0| 69 73 20 70 6f 73 74 63 | 61 72 64 2d 77 61 72 65 |is postc|ard-ware|
|000012c0| 2e 20 49 66 20 79 6f 75 | 20 66 69 6e 64 20 69 74 |. If you| find it|
|000012d0| 0a 75 73 65 66 75 6c 2c | 20 73 65 6e 64 20 61 20 |.useful,| send a |
|000012e0| 70 6f 73 74 63 61 72 64 | 20 74 6f 20 74 68 69 73 |postcard| to this|
|000012f0| 20 61 64 64 72 65 73 73 | 3a 20 46 72 61 6e 6b 20 | address|: Frank |
|00001300| 52 69 64 64 65 72 62 75 | 73 63 68 2c 20 53 61 6e |Ridderbu|sch, San|
|00001310| 64 65 72 0a 53 74 72 2e | 7e 31 37 2c 20 57 2d 34 |der.Str.|~17, W-4|
|00001320| 37 39 30 7e 50 61 64 65 | 72 62 6f 72 6e 2c 20 47 |790~Pade|rborn, G|
|00001330| 65 72 6d 61 6e 79 2e 0a | 0a 25 25 25 25 25 25 25 |ermany..|.%%%%%%%|
|00001340| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001350| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001360| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001370| 25 25 25 25 25 0a 0c 0a | 5c 73 65 63 74 69 6f 6e |%%%%%...|\section|
|00001380| 7b 53 74 61 6e 64 61 72 | 64 20 49 2f 4f 7d 0a 0a |{Standar|d I/O}..|
|00001390| 5c 23 69 6e 63 6c 75 64 | 65 20 5c 3c 73 74 64 69 |\#includ|e \<stdi|
|000013a0| 6f 2e 68 3e 0a 0a 7b 5c | 6c 65 66 74 73 6b 69 70 |o.h>..{\|leftskip|
|000013b0| 3d 5c 6d 79 69 6e 64 65 | 6e 74 20 54 68 65 20 66 |=\myinde|nt The f|
|000013c0| 6f 6c 6c 6f 77 69 6e 67 | 20 61 6c 69 61 73 65 73 |ollowing| aliases|
|000013d0| 20 66 6f 72 20 73 6f 6d | 65 20 6f 66 20 74 68 65 | for som|e of the|
|000013e0| 20 62 65 6c 6f 77 0a 66 | 75 6e 63 74 69 6f 6e 73 | below.f|unctions|
|000013f0| 20 61 72 65 20 64 65 66 | 69 6e 65 64 2e 5c 70 61 | are def|ined.\pa|
|00001400| 72 7d 0a 0a 5c 62 65 67 | 69 6e 69 6e 64 65 6e 74 |r}..\beg|inindent|
|00001410| 65 64 6b 65 79 73 0a 5c | 70 61 72 61 6c 69 67 6e |edkeys.\|paralign|
|00001420| 20 74 6f 20 5c 68 73 69 | 7a 65 7b 23 5c 74 61 62 | to \hsi|ze{#\tab|
|00001430| 73 6b 69 70 3d 31 30 70 | 74 20 70 6c 75 73 20 31 |skip=10p|t plus 1|
|00001440| 20 66 69 6c 5c 68 66 69 | 6c 26 23 5c 68 66 69 6c | fil\hfi|l&#\hfil|
|00001450| 5c 63 72 0a 20 20 5c 74 | 77 6f 63 6f 6c 7b 67 65 |\cr. \t|wocol{ge|
|00001460| 74 63 7d 7b 66 67 65 74 | 63 7d 0a 20 20 5c 74 77 |tc}{fget|c}. \tw|
|00001470| 6f 63 6f 6c 7b 75 6e 67 | 65 74 63 7d 7b 66 75 6e |ocol{ung|etc}{fun|
|00001480| 67 65 74 63 7d 0a 20 20 | 5c 74 77 6f 63 6f 6c 7b |getc}. |\twocol{|
|00001490| 70 75 74 63 7d 7b 66 70 | 75 74 63 7d 0a 20 20 5c |putc}{fp|utc}. \|
|000014a0| 74 77 6f 63 6f 6c 7b 67 | 65 74 63 68 61 72 28 29 |twocol{g|etchar()|
|000014b0| 7d 7b 66 67 65 74 63 28 | 73 74 64 69 6e 29 7d 0a |}{fgetc(|stdin)}.|
|000014c0| 20 20 5c 74 77 6f 63 6f | 6c 7b 75 6e 67 65 74 63 | \twoco|l{ungetc|
|000014d0| 68 61 72 28 63 29 7d 7b | 66 75 6e 67 65 74 63 28 |har(c)}{|fungetc(|
|000014e0| 28 63 29 2c 73 74 64 69 | 6e 29 7d 0a 20 20 5c 74 |(c),stdi|n)}. \t|
|000014f0| 77 6f 63 6f 6c 7b 70 75 | 74 63 68 61 72 28 63 29 |wocol{pu|tchar(c)|
|00001500| 7d 7b 66 70 75 74 63 28 | 28 63 29 2c 73 74 64 6f |}{fputc(|(c),stdo|
|00001510| 75 74 29 7d 0a 7d 5c 65 | 6e 64 69 6e 64 65 6e 74 |ut)}.}\e|ndindent|
|00001520| 65 64 6b 65 79 73 0a 0a | 5c 66 75 6e 63 74 69 6f |edkeys..|\functio|
|00001530| 6e 7b 76 6f 69 64 20 63 | 6c 65 61 72 65 72 72 28 |n{void c|learerr(|
|00001540| 46 49 4c 45 20 5c 2a 66 | 70 29 3b 7d 0a 5c 65 78 |FILE \*f|p);}.\ex|
|00001550| 70 6c 7b 43 6c 65 61 72 | 20 65 72 72 6f 72 20 61 |pl{Clear| error a|
|00001560| 6e 64 20 45 4f 46 20 73 | 74 61 74 75 73 20 6f 66 |nd EOF s|tatus of|
|00001570| 20 73 74 72 65 61 6d 20 | 7b 5c 73 6c 20 66 70 7d | stream |{\sl fp}|
|00001580| 2e 20 28 4d 61 63 72 6f | 29 7d 0a 0a 5c 66 75 6e |. (Macro|)}..\fun|
|00001590| 63 74 69 6f 6e 7b 63 68 | 61 72 20 5c 2a 63 74 65 |ction{ch|ar \*cte|
|000015a0| 72 6d 69 64 28 63 68 61 | 72 20 5c 2a 6e 61 6d 65 |rmid(cha|r \*name|
|000015b0| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 7d 0a 0a 5c 66 75 |);}.\exp|l{}..\fu|
|000015c0| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 66 63 6c 6f 73 |nction{i|nt fclos|
|000015d0| 65 28 46 49 4c 45 20 5c | 2a 66 70 29 3b 7d 0a 5c |e(FILE \|*fp);}.\|
|000015e0| 65 78 70 6c 7b 43 6c 6f | 73 65 20 74 68 65 20 73 |expl{Clo|se the s|
|000015f0| 74 72 65 61 6d 20 7b 5c | 73 6c 20 66 70 7d 2e 7d |tream {\|sl fp}.}|
|00001600| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 46 49 4c 45 |..\funct|ion{FILE|
|00001610| 20 5c 2a 66 64 6f 70 65 | 6e 28 69 6e 74 20 66 64 | \*fdope|n(int fd|
|00001620| 2c 20 63 6f 6e 73 74 7e | 63 68 61 72 20 5c 2a 6d |, const~|char \*m|
|00001630| 6f 64 65 29 3b 7d 0a 5c | 65 78 70 6c 7b 43 6f 6e |ode);}.\|expl{Con|
|00001640| 6e 65 63 74 20 61 20 66 | 69 6c 65 20 70 6f 69 6e |nect a f|ile poin|
|00001650| 74 65 72 20 74 6f 20 74 | 68 65 20 66 69 6c 65 20 |ter to t|he file |
|00001660| 64 65 73 63 72 69 70 74 | 6f 72 20 7b 5c 73 6c 20 |descript|or {\sl |
|00001670| 66 64 7d 20 77 69 74 68 | 20 6d 6f 64 65 0a 7b 5c |fd} with| mode.{\|
|00001680| 73 6c 20 6d 6f 64 65 7d | 2e 7d 0a 0a 5c 66 75 6e |sl mode}|.}..\fun|
|00001690| 63 74 69 6f 6e 7b 69 6e | 74 20 66 65 6f 66 28 46 |ction{in|t feof(F|
|000016a0| 49 4c 45 20 5c 2a 66 70 | 29 3b 7d 0a 5c 65 78 70 |ILE \*fp|);}.\exp|
|000016b0| 6c 7b 54 65 73 74 20 45 | 4f 46 20 73 74 61 74 75 |l{Test E|OF statu|
|000016c0| 73 20 6f 66 20 73 74 72 | 65 61 6d 20 7b 5c 73 6c |s of str|eam {\sl|
|000016d0| 20 66 70 7d 2e 20 28 4d | 61 63 72 6f 29 7d 0a 0a | fp}. (M|acro)}..|
|000016e0| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 66 65 |\functio|n{int fe|
|000016f0| 72 72 6f 72 28 46 49 4c | 45 20 5c 2a 66 70 29 3b |rror(FIL|E \*fp);|
|00001700| 7d 0a 5c 65 78 70 6c 7b | 54 65 73 74 20 65 72 72 |}.\expl{|Test err|
|00001710| 6f 72 20 73 74 61 74 75 | 73 20 6f 66 20 73 74 72 |or statu|s of str|
|00001720| 65 61 6d 20 7b 5c 73 6c | 20 66 70 7d 2e 20 28 4d |eam {\sl| fp}. (M|
|00001730| 61 63 72 6f 29 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |acro)}..|\functio|
|00001740| 6e 7b 69 6e 74 20 66 66 | 6c 75 73 68 28 46 49 4c |n{int ff|lush(FIL|
|00001750| 45 20 5c 2a 66 70 29 3b | 7d 0a 5c 65 78 70 6c 7b |E \*fp);|}.\expl{|
|00001760| 57 72 69 74 65 20 64 61 | 74 61 20 66 72 6f 6d 20 |Write da|ta from |
|00001770| 69 6e 74 65 72 6e 61 6c | 20 62 75 66 66 65 72 20 |internal| buffer |
|00001780| 6f 66 20 73 74 72 65 61 | 6d 20 7b 5c 73 6c 20 66 |of strea|m {\sl f|
|00001790| 70 7d 20 74 6f 20 74 68 | 65 20 66 69 6c 65 2e 7d |p} to th|e file.}|
|000017a0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |..\funct|ion{int |
|000017b0| 66 67 65 74 63 28 46 49 | 4c 45 20 5c 2a 66 70 29 |fgetc(FI|LE \*fp)|
|000017c0| 3b 7d 0a 5c 65 78 70 6c | 7b 47 65 74 20 61 20 63 |;}.\expl|{Get a c|
|000017d0| 68 61 72 61 63 74 65 72 | 20 66 72 6f 6d 20 73 74 |haracter| from st|
|000017e0| 72 65 61 6d 20 7b 5c 73 | 6c 20 66 70 7d 2e 7d 0a |ream {\s|l fp}.}.|
|000017f0| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 69 6e 74 20 66 |.\functi|on{int f|
|00001800| 67 65 74 70 6f 73 28 46 | 49 4c 45 20 5c 2a 66 70 |getpos(F|ILE \*fp|
|00001810| 2c 20 66 70 6f 73 5c 5f | 74 20 5c 2a 70 74 72 29 |, fpos\_|t \*ptr)|
|00001820| 3b 7d 0a 5c 65 78 70 6c | 7b 50 75 74 20 74 68 65 |;}.\expl|{Put the|
|00001830| 20 63 75 72 72 65 6e 74 | 20 70 6f 73 69 74 69 6f | current| positio|
|00001840| 6e 20 6f 66 20 74 68 65 | 20 66 69 6c 65 20 70 6f |n of the| file po|
|00001850| 69 6e 74 65 72 20 6f 66 | 20 73 74 72 65 61 6d 20 |inter of| stream |
|00001860| 7b 5c 73 6c 20 66 70 7d | 0a 69 6e 74 6f 20 74 68 |{\sl fp}|.into th|
|00001870| 65 20 61 64 64 72 65 73 | 73 20 7b 5c 73 6c 20 70 |e addres|s {\sl p|
|00001880| 74 72 7d 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |tr}.}..\|function|
|00001890| 7b 63 68 61 72 20 5c 2a | 66 67 65 74 73 28 63 68 |{char \*|fgets(ch|
|000018a0| 61 72 20 5c 2a 62 75 66 | 2c 20 69 6e 74 20 6d 61 |ar \*buf|, int ma|
|000018b0| 78 2c 20 46 49 4c 45 20 | 5c 2a 66 70 29 3b 7d 0a |x, FILE |\*fp);}.|
|000018c0| 5c 65 78 70 6c 7b 47 65 | 74 20 61 20 73 74 72 69 |\expl{Ge|t a stri|
|000018d0| 6e 67 20 69 6e 63 6c 75 | 64 69 6e 67 20 74 68 65 |ng inclu|ding the|
|000018e0| 20 4e 4c 20 63 68 61 72 | 61 63 74 65 72 20 66 72 | NL char|acter fr|
|000018f0| 6f 6d 20 73 74 72 65 61 | 6d 20 7b 5c 73 6c 20 66 |om strea|m {\sl f|
|00001900| 70 7d 0a 77 69 74 68 20 | 7b 5c 73 6c 20 6d 61 78 |p}.with |{\sl max|
|00001910| 7d 20 62 79 74 65 20 69 | 6e 74 6f 20 7b 5c 73 6c |} byte i|nto {\sl|
|00001920| 20 62 75 66 7d 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 | buf}.}.|.\functi|
|00001930| 6f 6e 7b 69 6e 74 20 66 | 69 6c 65 6e 6f 28 46 49 |on{int f|ileno(FI|
|00001940| 4c 45 20 5c 2a 66 70 29 | 3b 7d 0a 5c 65 78 70 6c |LE \*fp)|;}.\expl|
|00001950| 7b 47 65 74 20 66 69 6c | 65 20 64 65 73 63 72 69 |{Get fil|e descri|
|00001960| 70 74 6f 72 20 6f 66 20 | 73 74 72 65 61 6d 20 7b |ptor of |stream {|
|00001970| 5c 73 6c 20 66 70 7d 2e | 20 28 4d 61 63 72 6f 29 |\sl fp}.| (Macro)|
|00001980| 7d 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 46 49 4c |}..\func|tion{FIL|
|00001990| 45 20 5c 2a 66 6f 70 65 | 6e 28 63 6f 6e 73 74 7e |E \*fope|n(const~|
|000019a0| 63 68 61 72 20 5c 2a 66 | 6e 61 6d 65 2c 20 63 6f |char \*f|name, co|
|000019b0| 6e 73 74 7e 63 68 61 72 | 20 5c 2a 6d 6f 64 65 29 |nst~char| \*mode)|
|000019c0| 3b 7d 0a 5c 65 78 70 6c | 7b 4f 70 65 6e 20 66 69 |;}.\expl|{Open fi|
|000019d0| 6c 65 20 7b 5c 73 6c 20 | 66 6e 61 6d 65 7d 20 77 |le {\sl |fname} w|
|000019e0| 69 74 68 20 6d 6f 64 65 | 20 7b 5c 73 6c 20 6d 6f |ith mode| {\sl mo|
|000019f0| 64 65 7d 20 66 6f 72 20 | 73 74 72 65 61 6d 20 49 |de} for |stream I|
|00001a00| 2f 4f 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |/O.}..\f|unction{|
|00001a10| 69 6e 74 20 66 70 75 74 | 63 28 69 6e 74 20 63 2c |int fput|c(int c,|
|00001a20| 20 46 49 4c 45 20 5c 2a | 66 70 29 3b 7d 0a 5c 65 | FILE \*|fp);}.\e|
|00001a30| 78 70 6c 7b 57 72 69 74 | 65 20 61 20 63 68 61 72 |xpl{Writ|e a char|
|00001a40| 61 63 74 65 72 20 7b 5c | 73 6c 20 63 7d 20 69 6e |acter {\|sl c} in|
|00001a50| 74 6f 20 73 74 72 65 61 | 6d 20 7b 5c 73 6c 20 66 |to strea|m {\sl f|
|00001a60| 70 7d 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |p}.}..\f|unction{|
|00001a70| 69 6e 74 20 66 70 75 74 | 73 28 63 6f 6e 73 74 7e |int fput|s(const~|
|00001a80| 63 68 61 72 20 5c 2a 62 | 75 66 2c 20 46 49 4c 45 |char \*b|uf, FILE|
|00001a90| 20 5c 2a 66 70 29 3b 7d | 0a 5c 65 78 70 6c 7b 57 | \*fp);}|.\expl{W|
|00001aa0| 72 69 74 65 20 74 68 65 | 20 73 74 72 69 6e 67 20 |rite the| string |
|00001ab0| 69 6e 20 7b 5c 73 6c 20 | 62 75 66 7d 20 69 6e 74 |in {\sl |buf} int|
|00001ac0| 6f 20 73 74 72 65 61 6d | 20 7b 5c 73 6c 20 66 70 |o stream| {\sl fp|
|00001ad0| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 73 |}.}..\fu|nction{s|
|00001ae0| 69 7a 65 5c 5f 74 20 66 | 72 65 61 64 28 76 6f 69 |ize\_t f|read(voi|
|00001af0| 64 20 5c 2a 62 75 66 2c | 20 73 69 7a 65 5c 5f 74 |d \*buf,| size\_t|
|00001b00| 20 73 7a 2c 20 73 69 7a | 65 5c 5f 74 20 6e 6f 2c | sz, siz|e\_t no,|
|00001b10| 20 46 49 4c 45 20 5c 2a | 66 70 29 3b 7d 0a 5c 65 | FILE \*|fp);}.\e|
|00001b20| 78 70 6c 7b 52 65 61 64 | 20 7b 5c 73 6c 20 6e 6f |xpl{Read| {\sl no|
|00001b30| 7d 20 69 74 65 6d 73 20 | 6f 66 20 73 69 7a 65 20 |} items |of size |
|00001b40| 7b 5c 73 6c 20 73 7a 7d | 20 66 72 6f 6d 20 73 74 |{\sl sz}| from st|
|00001b50| 72 65 61 6d 20 7b 5c 73 | 6c 20 66 70 7d 20 69 6e |ream {\s|l fp} in|
|00001b60| 74 6f 20 0a 7b 5c 73 6c | 20 62 75 66 7d 2e 7d 0a |to .{\sl| buf}.}.|
|00001b70| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 46 49 4c 45 20 |.\functi|on{FILE |
|00001b80| 5c 2a 66 72 65 6f 70 65 | 6e 28 63 6f 6e 73 74 7e |\*freope|n(const~|
|00001b90| 63 68 61 72 20 5c 2a 66 | 6e 61 6d 65 2c 20 63 6f |char \*f|name, co|
|00001ba0| 6e 73 74 7e 63 68 61 72 | 20 5c 2a 6d 6f 64 65 2c |nst~char| \*mode,|
|00001bb0| 20 46 49 4c 45 20 5c 2a | 66 70 29 3b 7d 0a 5c 65 | FILE \*|fp);}.\e|
|00001bc0| 78 70 6c 7b 52 65 6f 70 | 65 6e 20 7b 5c 73 6c 20 |xpl{Reop|en {\sl |
|00001bd0| 66 70 7d 20 77 69 74 68 | 20 66 69 6c 65 20 7b 5c |fp} with| file {\|
|00001be0| 73 6c 20 66 6e 61 6d 65 | 7d 20 61 6e 64 20 6d 6f |sl fname|} and mo|
|00001bf0| 64 65 20 7b 5c 73 6c 20 | 6d 6f 64 65 7d 2e 7d 0a |de {\sl |mode}.}.|
|00001c00| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 69 6e 74 20 66 |.\functi|on{int f|
|00001c10| 73 65 65 6b 28 46 49 4c | 45 20 5c 2a 66 70 2c 20 |seek(FIL|E \*fp, |
|00001c20| 6c 6f 6e 67 20 70 6f 73 | 2c 20 69 6e 74 20 77 68 |long pos|, int wh|
|00001c30| 65 6e 63 65 29 3b 7d 0a | 5c 65 78 70 6c 7b 4d 6f |ence);}.|\expl{Mo|
|00001c40| 76 65 20 74 68 65 20 74 | 68 65 20 66 69 6c 65 20 |ve the t|he file |
|00001c50| 70 6f 69 6e 74 65 72 20 | 66 72 6f 6d 20 73 74 72 |pointer |from str|
|00001c60| 65 61 6d 20 7b 5c 73 6c | 20 66 70 7d 20 74 6f 20 |eam {\sl| fp} to |
|00001c70| 70 6f 73 69 74 69 6f 6e | 20 7b 5c 73 6c 20 70 6f |position| {\sl po|
|00001c80| 73 7d 0a 72 65 6c 61 74 | 69 76 20 74 6f 20 7b 5c |s}.relat|iv to {\|
|00001c90| 73 6c 20 77 68 65 6e 63 | 65 7d 2e 7d 0a 0a 5c 66 |sl whenc|e}.}..\f|
|00001ca0| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 66 73 65 74 |unction{|int fset|
|00001cb0| 70 6f 73 28 46 49 4c 45 | 20 5c 2a 66 70 2c 20 66 |pos(FILE| \*fp, f|
|00001cc0| 70 6f 73 5c 5f 74 20 5c | 2a 70 74 72 29 3b 7d 0a |pos\_t \|*ptr);}.|
|00001cd0| 5c 65 78 70 6c 7b 53 65 | 74 20 74 68 65 20 70 6f |\expl{Se|t the po|
|00001ce0| 73 69 74 69 6f 6e 20 6f | 66 20 74 68 65 20 66 69 |sition o|f the fi|
|00001cf0| 6c 65 20 70 6f 69 6e 74 | 65 72 20 6f 66 20 73 74 |le point|er of st|
|00001d00| 72 65 61 6d 20 7b 5c 73 | 6c 20 66 70 7d 20 74 6f |ream {\s|l fp} to|
|00001d10| 20 74 68 65 0a 76 61 6c | 75 65 20 61 74 20 61 64 | the.val|ue at ad|
|00001d20| 64 72 65 73 73 20 7b 5c | 73 6c 20 70 74 72 7d 2e |dress {\|sl ptr}.|
|00001d30| 7d 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 6c 6f 6e |}..\func|tion{lon|
|00001d40| 67 20 66 74 65 6c 6c 28 | 46 49 4c 45 20 5c 2a 66 |g ftell(|FILE \*f|
|00001d50| 70 29 3b 7d 0a 5c 65 78 | 70 6c 7b 47 65 74 20 74 |p);}.\ex|pl{Get t|
|00001d60| 68 65 20 63 75 72 72 65 | 6e 74 20 70 6f 73 69 74 |he curre|nt posit|
|00001d70| 69 6f 6e 20 6f 66 20 74 | 68 65 20 66 69 6c 65 20 |ion of t|he file |
|00001d80| 70 6f 69 6e 74 65 72 20 | 66 72 6f 6d 20 73 74 72 |pointer |from str|
|00001d90| 65 61 6d 20 7b 5c 73 6c | 20 66 70 7d 2e 7d 0a 0a |eam {\sl| fp}.}..|
|00001da0| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 66 75 |\functio|n{int fu|
|00001db0| 6e 67 65 74 63 28 69 6e | 74 20 63 2c 20 46 49 4c |ngetc(in|t c, FIL|
|00001dc0| 45 20 5c 2a 66 70 29 3b | 7d 0a 5c 65 78 70 6c 7b |E \*fp);|}.\expl{|
|00001dd0| 50 75 73 68 20 74 68 65 | 20 63 68 61 72 61 63 74 |Push the| charact|
|00001de0| 65 72 20 7b 5c 73 6c 20 | 63 7d 20 62 61 63 6b 20 |er {\sl |c} back |
|00001df0| 6f 6e 74 6f 20 73 74 72 | 65 61 6d 20 7b 5c 73 6c |onto str|eam {\sl|
|00001e00| 20 66 70 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f | fp}.}..|\functio|
|00001e10| 6e 7b 73 69 7a 65 5c 5f | 74 20 66 77 72 69 74 65 |n{size\_|t fwrite|
|00001e20| 28 63 6f 6e 73 74 7e 76 | 6f 69 64 20 5c 2a 62 75 |(const~v|oid \*bu|
|00001e30| 66 2c 20 73 69 7a 65 5c | 5f 74 20 73 69 7a 65 2c |f, size\|_t size,|
|00001e40| 20 73 69 7a 65 5c 5f 74 | 20 6e 6f 20 2c 20 46 49 | size\_t| no , FI|
|00001e50| 4c 45 20 5c 2a 66 70 29 | 3b 7d 0a 5c 65 78 70 6c |LE \*fp)|;}.\expl|
|00001e60| 7b 57 72 69 74 65 20 7b | 5c 73 6c 20 6e 6f 7d 20 |{Write {|\sl no} |
|00001e70| 69 74 65 6d 73 20 6f 66 | 20 73 69 7a 65 20 7b 5c |items of| size {\|
|00001e80| 73 6c 20 73 7a 7d 20 66 | 72 6f 6d 20 7b 5c 73 6c |sl sz} f|rom {\sl|
|00001e90| 20 62 75 66 7d 20 69 6e | 74 6f 20 73 74 72 65 61 | buf} in|to strea|
|00001ea0| 6d 0a 7b 5c 73 6c 20 66 | 70 7d 2e 7d 0a 0a 5c 66 |m.{\sl f|p}.}..\f|
|00001eb0| 75 6e 63 74 69 6f 6e 7b | 6c 6f 6e 67 20 67 65 74 |unction{|long get|
|00001ec0| 6c 28 46 49 4c 45 20 5c | 2a 66 70 29 3b 7d 0a 5c |l(FILE \|*fp);}.\|
|00001ed0| 65 78 70 6c 7b 52 65 61 | 64 20 61 20 6c 6f 6e 67 |expl{Rea|d a long|
|00001ee0| 20 76 61 6c 75 65 20 66 | 72 6f 6d 20 73 74 72 65 | value f|rom stre|
|00001ef0| 61 6d 20 7b 5c 73 6c 20 | 66 70 7d 2e 7d 0a 0a 5c |am {\sl |fp}.}..\|
|00001f00| 66 75 6e 63 74 69 6f 6e | 7b 63 68 61 72 20 5c 2a |function|{char \*|
|00001f10| 67 65 74 73 28 63 68 61 | 72 20 5c 2a 62 75 66 29 |gets(cha|r \*buf)|
|00001f20| 3b 7d 0a 5c 65 78 70 6c | 7b 47 65 74 20 61 20 73 |;}.\expl|{Get a s|
|00001f30| 74 72 69 6e 67 20 66 72 | 6f 6d 20 5c 3c 73 74 64 |tring fr|om \<std|
|00001f40| 69 6e 3e 20 69 6e 74 6f | 20 7b 5c 73 6c 20 62 75 |in> into| {\sl bu|
|00001f50| 66 7d 2e 20 54 68 65 20 | 4e 4c 20 63 68 61 72 61 |f}. The |NL chara|
|00001f60| 63 74 65 72 20 69 73 20 | 0a 64 69 73 63 61 72 64 |cter is |.discard|
|00001f70| 65 64 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |ed.}..\f|unction{|
|00001f80| 73 68 6f 72 74 20 67 65 | 74 77 28 46 49 4c 45 20 |short ge|tw(FILE |
|00001f90| 5c 2a 66 70 29 3b 7d 0a | 5c 65 78 70 6c 7b 52 65 |\*fp);}.|\expl{Re|
|00001fa0| 61 64 20 61 20 73 68 6f | 72 74 20 76 61 6c 75 65 |ad a sho|rt value|
|00001fb0| 20 66 72 6f 6d 20 73 74 | 72 65 61 6d 20 7b 5c 73 | from st|ream {\s|
|00001fc0| 6c 20 66 70 7d 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 |l fp}.}.|.\functi|
|00001fd0| 6f 6e 7b 69 6e 74 20 70 | 63 6c 6f 73 65 28 46 49 |on{int p|close(FI|
|00001fe0| 4c 45 20 5c 2a 66 70 29 | 3b 7d 0a 5c 65 78 70 6c |LE \*fp)|;}.\expl|
|00001ff0| 7b 43 6c 6f 73 65 20 74 | 68 65 20 73 74 72 65 61 |{Close t|he strea|
|00002000| 6d 20 63 72 65 61 74 65 | 64 20 62 79 20 7b 5c 62 |m create|d by {\b|
|00002010| 66 20 70 6f 70 65 6e 28 | 29 7d 2e 7d 0a 0a 5c 66 |f popen(|)}.}..\f|
|00002020| 75 6e 63 74 69 6f 6e 7b | 76 6f 69 64 20 70 65 72 |unction{|void per|
|00002030| 72 6f 72 28 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |ror(cons|t~char \|
|00002040| 2a 73 74 72 29 3b 7d 0a | 5c 65 78 70 6c 7b 44 69 |*str);}.|\expl{Di|
|00002050| 73 70 6c 61 79 20 65 72 | 72 6f 72 20 6d 65 73 73 |splay er|ror mess|
|00002060| 61 67 65 20 73 74 61 72 | 74 69 6e 67 20 77 69 74 |age star|ting wit|
|00002070| 68 20 7b 5c 73 6c 20 73 | 74 72 7d 20 64 65 70 65 |h {\sl s|tr} depe|
|00002080| 6e 64 69 6e 67 20 6f 6e | 20 7b 5c 73 6c 0a 65 72 |nding on| {\sl.er|
|00002090| 72 6e 6f 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |rno}.}..|\functio|
|000020a0| 6e 7b 46 49 4c 45 20 5c | 2a 70 6f 70 65 6e 28 63 |n{FILE \|*popen(c|
|000020b0| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 63 6f 6d 6d |onst~cha|r \*comm|
|000020c0| 61 6e 64 2c 20 63 6f 6e | 73 74 7e 63 68 61 72 20 |and, con|st~char |
|000020d0| 5c 2a 6d 6f 64 65 29 3b | 7d 0a 5c 65 78 70 6c 7b |\*mode);|}.\expl{|
|000020e0| 4f 70 65 6e 20 61 20 70 | 69 70 65 20 77 69 74 68 |Open a p|ipe with|
|000020f0| 20 7b 5c 73 6c 20 6d 6f | 64 65 7d 20 74 6f 20 7b | {\sl mo|de} to {|
|00002100| 5c 73 6c 20 63 6f 6d 6d | 61 6e 64 7d 2e 20 28 46 |\sl comm|and}. (F|
|00002110| 61 6b 65 64 20 62 79 20 | 74 65 6d 70 6f 72 61 72 |aked by |temporar|
|00002120| 79 0a 66 69 6c 65 73 29 | 7d 0a 0a 5c 66 75 6e 63 |y.files)|}..\func|
|00002130| 74 69 6f 6e 7b 69 6e 74 | 20 70 72 69 6e 74 66 28 |tion{int| printf(|
|00002140| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 66 6d 74 |const~ch|ar \*fmt|
|00002150| 2c 20 24 5c 6c 64 6f 74 | 73 24 29 3b 7d 0a 5c 66 |, $\ldot|s$);}.\f|
|00002160| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 66 70 72 69 |unction{|int fpri|
|00002170| 6e 74 66 28 46 49 4c 45 | 20 5c 2a 66 70 2c 20 63 |ntf(FILE| \*fp, c|
|00002180| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 66 6d 74 2c |onst~cha|r \*fmt,|
|00002190| 20 24 5c 6c 64 6f 74 73 | 24 29 3b 7d 0a 5c 66 75 | $\ldots|$);}.\fu|
|000021a0| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 73 70 72 69 6e |nction{i|nt sprin|
|000021b0| 74 66 28 63 68 61 72 20 | 5c 2a 62 75 66 2c 20 63 |tf(char |\*buf, c|
|000021c0| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 66 6d 74 2c |onst~cha|r \*fmt,|
|000021d0| 20 24 5c 6c 64 6f 74 73 | 24 29 3b 7d 0a 5c 66 75 | $\ldots|$);}.\fu|
|000021e0| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 76 70 72 69 6e |nction{i|nt vprin|
|000021f0| 74 66 28 63 6f 6e 73 74 | 7e 63 68 61 72 20 5c 2a |tf(const|~char \*|
|00002200| 66 6d 74 2c 20 63 68 61 | 72 20 5c 2a 29 3b 7d 0a |fmt, cha|r \*);}.|
|00002210| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 76 66 |\functio|n{int vf|
|00002220| 70 72 69 6e 74 66 28 46 | 49 4c 45 20 5c 2a 66 70 |printf(F|ILE \*fp|
|00002230| 2c 20 63 6f 6e 73 74 7e | 63 68 61 72 20 5c 2a 66 |, const~|char \*f|
|00002240| 6d 74 2c 20 63 68 61 72 | 20 5c 2a 29 3b 7d 0a 5c |mt, char| \*);}.\|
|00002250| 66 75 6e 63 74 69 6f 6e | 7b 69 6e 74 20 76 73 70 |function|{int vsp|
|00002260| 72 69 6e 74 66 28 63 68 | 61 72 20 5c 2a 62 75 66 |rintf(ch|ar \*buf|
|00002270| 2c 20 63 6f 6e 73 74 7e | 63 68 61 72 20 5c 2a 66 |, const~|char \*f|
|00002280| 6d 74 2c 20 63 68 61 72 | 20 5c 2a 29 3b 7d 0a 5c |mt, char| \*);}.\|
|00002290| 65 78 70 6c 7b 46 6f 72 | 6d 61 74 65 64 20 6f 75 |expl{For|mated ou|
|000022a0| 74 70 75 74 20 74 6f 20 | 65 69 74 68 65 72 20 5c |tput to |either \|
|000022b0| 3c 73 74 64 6f 75 74 3e | 2c 20 7b 5c 73 6c 20 66 |<stdout>|, {\sl f|
|000022c0| 70 7d 20 6f 72 20 7b 5c | 73 6c 20 62 75 66 7d 20 |p} or {\|sl buf} |
|000022d0| 77 69 74 68 20 66 69 78 | 65 64 20 0a 6f 72 20 76 |with fix|ed .or v|
|000022e0| 61 72 69 61 62 6c 65 20 | 6e 75 6d 62 65 72 20 6f |ariable |number o|
|000022f0| 66 20 61 72 67 75 6d 65 | 6e 74 73 2e 7d 0a 0a 7b |f argume|nts.}..{|
|00002300| 5c 6c 65 66 74 73 6b 69 | 70 3d 5c 6d 79 69 6e 64 |\leftski|p=\myind|
|00002310| 65 6e 74 20 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |ent The |followin|
|00002320| 67 20 74 61 62 6c 65 20 | 6c 69 73 74 73 20 74 68 |g table |lists th|
|00002330| 65 20 69 64 65 6e 74 69 | 66 79 69 6e 67 20 6c 65 |e identi|fying le|
|00002340| 74 74 65 72 73 20 6f 66 | 0a 74 68 65 20 7b 5c 73 |tters of|.the {\s|
|00002350| 6c 20 66 6d 74 7d 20 73 | 74 72 69 6e 67 2e 5c 70 |l fmt} s|tring.\p|
|00002360| 61 72 7d 0a 0a 5c 62 65 | 67 69 6e 69 6e 64 65 6e |ar}..\be|gininden|
|00002370| 74 65 64 6b 65 79 73 5c | 62 65 67 69 6e 74 68 72 |tedkeys\|beginthr|
|00002380| 65 65 63 6f 6c 75 6d 6e | 0a 20 20 5c 74 68 72 65 |eecolumn|. \thre|
|00002390| 65 63 6f 6c 72 75 6c 65 | 7b 73 63 61 6e 66 7d 7b |ecolrule|{scanf}{|
|000023a0| 70 72 69 6e 74 66 7d 7b | 4d 65 61 6e 69 6e 67 7d |printf}{|Meaning}|
|000023b0| 0a 20 20 5c 6e 6f 61 6c | 69 67 6e 7b 5c 68 72 75 |. \noal|ign{\hru|
|000023c0| 6c 65 7d 0a 20 20 5c 74 | 68 72 65 65 63 6f 6c 72 |le}. \t|hreecolr|
|000023d0| 75 6c 65 7b 64 7d 7b 64 | 2c 69 7d 7b 44 65 63 69 |ule{d}{d|,i}{Deci|
|000023e0| 6d 61 6c 20 6e 75 6d 62 | 65 72 7d 0a 20 20 5c 74 |mal numb|er}. \t|
|000023f0| 68 72 65 65 63 6f 6c 72 | 75 6c 65 7b 6f 7d 7b 6f |hreecolr|ule{o}{o|
|00002400| 7d 7b 4f 63 74 61 6c 20 | 6e 75 6d 62 65 72 7d 0a |}{Octal |number}.|
|00002410| 20 20 5c 74 68 72 65 65 | 63 6f 6c 72 75 6c 65 7b | \three|colrule{|
|00002420| 78 7d 7b 78 2c 58 7d 7b | 48 65 78 61 64 65 63 69 |x}{x,X}{|Hexadeci|
|00002430| 6d 61 6c 20 6e 75 6d 62 | 65 72 7d 0a 20 20 5c 74 |mal numb|er}. \t|
|00002440| 68 72 65 65 63 6f 6c 72 | 75 6c 65 7b 75 7d 7b 75 |hreecolr|ule{u}{u|
|00002450| 7d 7b 55 6e 73 69 67 6e | 65 64 20 64 65 63 69 6d |}{Unsign|ed decim|
|00002460| 61 6c 20 6e 2e 7d 0a 20 | 20 5c 74 68 72 65 65 63 |al n.}. | \threec|
|00002470| 6f 6c 72 75 6c 65 7b 62 | 7d 7b 5c 6f 6d 69 74 7d |olrule{b|}{\omit}|
|00002480| 7b 55 6e 73 69 67 6e 65 | 64 20 62 69 6e 61 72 79 |{Unsigne|d binary|
|00002490| 20 69 6e 74 2e 7d 0a 20 | 20 5c 74 68 72 65 65 63 | int.}. | \threec|
|000024a0| 6f 6c 72 75 6c 65 7b 69 | 7d 7b 5c 6f 6d 69 74 7d |olrule{i|}{\omit}|
|000024b0| 7b 41 6e 79 20 62 61 73 | 65 20 6e 75 6d 2e 7d 0a |{Any bas|e num.}.|
|000024c0| 20 20 5c 74 68 72 65 65 | 63 6f 6c 72 75 6c 65 7b | \three|colrule{|
|000024d0| 44 7d 7b 44 7d 7b 4c 6f | 6e 67 20 44 65 63 69 6d |D}{D}{Lo|ng Decim|
|000024e0| 61 6c 20 6e 75 6d 62 65 | 72 7d 0a 20 20 5c 74 68 |al numbe|r}. \th|
|000024f0| 72 65 65 63 6f 6c 72 75 | 6c 65 7b 4f 7d 7b 4f 7d |reecolru|le{O}{O}|
|00002500| 7b 4c 6f 6e 67 20 4f 63 | 74 61 6c 20 6e 75 6d 62 |{Long Oc|tal numb|
|00002510| 65 72 7d 0a 20 20 5c 74 | 68 72 65 65 63 6f 6c 72 |er}. \t|hreecolr|
|00002520| 75 6c 65 7b 55 7d 7b 55 | 7d 7b 55 6e 73 69 67 6e |ule{U}{U|}{Unsign|
|00002530| 65 64 20 6c 6f 6e 67 20 | 64 65 63 69 6d 61 6c 7d |ed long |decimal}|
|00002540| 0a 20 20 5c 74 68 72 65 | 65 63 6f 6c 72 75 6c 65 |. \thre|ecolrule|
|00002550| 7b 58 7d 7b 5c 6f 6d 69 | 74 7d 7b 4c 6f 6e 67 20 |{X}{\omi|t}{Long |
|00002560| 48 65 78 61 64 65 63 69 | 6d 61 6c 7d 0a 20 20 5c |Hexadeci|mal}. \|
|00002570| 74 68 72 65 65 63 6f 6c | 72 75 6c 65 7b 6c 64 2c |threecol|rule{ld,|
|00002580| 6c 6f 2c 6c 78 7d 7b 6c | 64 2c 6c 69 2c 6c 6f 2c |lo,lx}{l|d,li,lo,|
|00002590| 6c 78 2c 6c 58 7d 7b 4c | 6f 6e 67 20 24 5c 6c 64 |lx,lX}{L|ong $\ld|
|000025a0| 6f 74 73 24 20 6e 75 6d | 62 65 72 7d 0a 20 20 5c |ots$ num|ber}. \|
|000025b0| 74 68 72 65 65 63 6f 6c | 72 75 6c 65 7b 6c 62 7d |threecol|rule{lb}|
|000025c0| 7b 5c 6f 6d 69 74 7d 7b | 55 6e 73 69 67 6e 65 64 |{\omit}{|Unsigned|
|000025d0| 20 62 69 6e 61 72 79 20 | 6c 6f 6e 67 7d 0a 20 20 | binary |long}. |
|000025e0| 5c 74 68 72 65 65 63 6f | 6c 72 75 6c 65 7b 6c 69 |\threeco|lrule{li|
|000025f0| 7d 7b 5c 6f 6d 69 74 7d | 7b 41 6e 79 20 62 61 73 |}{\omit}|{Any bas|
|00002600| 65 20 6e 75 6d 2e 20 6c | 6f 6e 67 7d 0a 20 20 5c |e num. l|ong}. \|
|00002610| 74 68 72 65 65 63 6f 6c | 72 75 6c 65 7b 68 64 2c |threecol|rule{hd,|
|00002620| 68 6f 2c 68 78 7d 7b 64 | 2c 6f 2c 78 2c 58 7d 7b |ho,hx}{d|,o,x,X}{|
|00002630| 53 68 6f 72 74 20 24 5c | 6c 64 6f 74 73 24 20 6e |Short $\|ldots$ n|
|00002640| 75 6d 62 65 72 7d 0a 20 | 20 5c 74 68 72 65 65 63 |umber}. | \threec|
|00002650| 6f 6c 72 75 6c 65 7b 63 | 7d 7b 63 7d 7b 43 68 61 |olrule{c|}{c}{Cha|
|00002660| 72 61 63 74 65 72 7d 0a | 20 20 5c 74 68 72 65 65 |racter}.| \three|
|00002670| 63 6f 6c 72 75 6c 65 7b | 73 7d 7b 73 7d 7b 53 74 |colrule{|s}{s}{St|
|00002680| 72 69 6e 67 7d 0a 20 20 | 5c 74 68 72 65 65 63 6f |ring}. |\threeco|
|00002690| 6c 72 75 6c 65 7b 5c 6f | 6d 69 74 7d 7b 70 7d 7b |lrule{\o|mit}{p}{|
|000026a0| 50 6f 69 6e 74 65 72 7d | 0a 20 20 5c 74 68 72 65 |Pointer}|. \thre|
|000026b0| 65 63 6f 6c 72 75 6c 65 | 7b 5b 24 5c 6c 64 6f 74 |ecolrule|{[$\ldot|
|000026c0| 73 24 5d 7d 7b 5c 6f 6d | 69 74 7d 7b 53 74 72 2e |s$]}{\om|it}{Str.|
|000026d0| 20 63 6f 6e 73 69 73 74 | 2e 20 6f 66 20 63 68 61 | consist|. of cha|
|000026e0| 72 2e 7d 0a 20 20 5c 74 | 68 72 65 65 63 6f 6c 72 |r.}. \t|hreecolr|
|000026f0| 75 6c 65 7b 65 2c 66 2c | 67 7d 7b 66 7d 7b 46 69 |ule{e,f,|g}{f}{Fi|
|00002700| 78 65 64 2d 70 6f 69 6e | 74 20 6e 75 6d 62 65 72 |xed-poin|t number|
|00002710| 7d 0a 20 20 5c 74 68 72 | 65 65 63 6f 6c 72 75 6c |}. \thr|eecolrul|
|00002720| 65 7b 65 2c 66 2c 67 7d | 7b 65 2c 45 7d 7b 46 6c |e{e,f,g}|{e,E}{Fl|
|00002730| 6f 61 74 69 6e 67 2d 70 | 6f 69 6e 74 20 6e 75 6d |oating-p|oint num|
|00002740| 62 65 72 7d 0a 20 20 5c | 74 68 72 65 65 63 6f 6c |ber}. \|threecol|
|00002750| 72 75 6c 65 7b 6c 65 2c | 6c 66 2c 6c 67 7d 7b 5c |rule{le,|lf,lg}{\|
|00002760| 6f 6d 69 74 7d 7b 44 6f | 75 62 6c 65 20 70 72 65 |omit}{Do|uble pre|
|00002770| 63 2e 20 24 5c 6c 64 6f | 74 73 24 20 6e 2e 7d 0a |c. $\ldo|ts$ n.}.|
|00002780| 20 20 5c 74 68 72 65 65 | 63 6f 6c 72 75 6c 65 7b | \three|colrule{|
|00002790| 45 2c 46 2c 47 7d 7b 5c | 6f 6d 69 74 7d 7b 44 6f |E,F,G}{\|omit}{Do|
|000027a0| 75 62 6c 65 20 70 72 65 | 63 2e 20 24 5c 6c 64 6f |uble pre|c. $\ldo|
|000027b0| 74 73 24 20 6e 2e 7d 0a | 20 20 5c 74 68 72 65 65 |ts$ n.}.| \three|
|000027c0| 63 6f 6c 72 75 6c 65 7b | 4c 65 2c 4c 66 2c 4c 67 |colrule{|Le,Lf,Lg|
|000027d0| 7d 7b 4c 65 2c 4c 45 2c | 4c 66 7d 7b 4c 6f 6e 67 |}{Le,LE,|Lf}{Long|
|000027e0| 20 44 6f 75 62 6c 65 20 | 24 5c 6c 64 6f 74 73 24 | Double |$\ldots$|
|000027f0| 20 6e 2e 7d 0a 20 20 5c | 74 68 72 65 65 63 6f 6c | n.}. \|threecol|
|00002800| 72 75 6c 65 7b 5c 6f 6d | 69 74 7d 7b 67 2c 47 2c |rule{\om|it}{g,G,|
|00002810| 4c 67 2c 4c 47 7d 7b 65 | 2f 45 20 6f 72 20 66 20 |Lg,LG}{e|/E or f |
|00002820| 2d 20 73 68 6f 72 74 65 | 73 74 20 75 73 65 64 7d |- shorte|st used}|
|00002830| 0a 5c 65 6e 64 74 68 72 | 65 65 63 6f 6c 75 6d 6e |.\endthr|eecolumn|
|00002840| 5c 65 6e 64 69 6e 64 65 | 6e 74 65 64 6b 65 79 73 |\endinde|ntedkeys|
|00002850| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 6c 6f 6e 67 |..\funct|ion{long|
|00002860| 20 70 75 74 6c 28 6c 6f | 6e 67 20 63 2c 20 46 49 | putl(lo|ng c, FI|
|00002870| 4c 45 20 5c 2a 66 70 29 | 3b 7d 0a 5c 65 78 70 6c |LE \*fp)|;}.\expl|
|00002880| 7b 4f 75 74 70 75 74 20 | 74 68 65 20 6c 6f 6e 67 |{Output |the long|
|00002890| 20 76 61 6c 75 65 20 7b | 5c 73 6c 20 63 7d 20 69 | value {|\sl c} i|
|000028a0| 6e 74 6f 20 74 68 65 20 | 73 74 72 65 61 6d 20 7b |nto the |stream {|
|000028b0| 5c 73 6c 20 66 70 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |\sl fp}.|}..\func|
|000028c0| 74 69 6f 6e 7b 69 6e 74 | 20 70 75 74 73 28 63 6f |tion{int| puts(co|
|000028d0| 6e 73 74 7e 63 68 61 72 | 20 5c 2a 62 75 66 29 3b |nst~char| \*buf);|
|000028e0| 7d 0a 5c 65 78 70 6c 7b | 57 72 69 74 65 20 74 68 |}.\expl{|Write th|
|000028f0| 65 20 73 74 72 69 6e 67 | 20 69 6e 20 7b 5c 73 6c |e string| in {\sl|
|00002900| 20 62 75 66 7d 20 74 6f | 20 5c 3c 73 74 64 6f 75 | buf} to| \<stdou|
|00002910| 74 3e 20 61 70 70 65 6e | 64 69 6e 67 20 61 20 4e |t> appen|ding a N|
|00002920| 4c 20 0a 63 68 61 72 61 | 63 74 65 72 2e 7d 0a 0a |L .chara|cter.}..|
|00002930| 5c 66 75 6e 63 74 69 6f | 6e 7b 73 68 6f 72 74 20 |\functio|n{short |
|00002940| 70 75 74 77 28 73 68 6f | 72 74 20 63 2c 20 46 49 |putw(sho|rt c, FI|
|00002950| 4c 45 20 5c 2a 66 70 29 | 3b 7d 0a 5c 65 78 70 6c |LE \*fp)|;}.\expl|
|00002960| 7b 4f 75 74 70 75 74 20 | 74 68 65 20 73 68 6f 72 |{Output |the shor|
|00002970| 74 20 76 61 6c 75 65 20 | 7b 5c 73 6c 20 63 7d 20 |t value |{\sl c} |
|00002980| 69 6e 74 6f 20 74 68 65 | 20 73 74 72 65 61 6d 20 |into the| stream |
|00002990| 7b 5c 73 6c 20 66 70 7d | 2e 7d 0a 0a 5c 66 75 6e |{\sl fp}|.}..\fun|
|000029a0| 63 74 69 6f 6e 7b 69 6e | 74 20 72 65 6d 6f 76 65 |ction{in|t remove|
|000029b0| 28 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 66 6e |(const~c|har \*fn|
|000029c0| 61 6d 65 29 3b 7d 0a 5c | 65 78 70 6c 7b 52 65 6d |ame);}.\|expl{Rem|
|000029d0| 6f 76 65 20 66 69 6c 65 | 20 77 69 74 68 20 6e 61 |ove file| with na|
|000029e0| 6d 65 20 7b 5c 73 6c 20 | 66 6e 61 6d 65 7d 2e 7d |me {\sl |fname}.}|
|000029f0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |..\funct|ion{int |
|00002a00| 72 65 6e 61 6d 65 28 63 | 6f 6e 73 74 7e 63 68 61 |rename(c|onst~cha|
|00002a10| 72 20 5c 2a 6f 6c 64 2c | 20 63 6f 6e 73 74 7e 63 |r \*old,| const~c|
|00002a20| 68 61 72 20 5c 2a 6e 65 | 77 29 3b 7d 0a 5c 65 78 |har \*ne|w);}.\ex|
|00002a30| 70 6c 7b 43 68 61 6e 67 | 65 20 6e 61 6d 65 20 6f |pl{Chang|e name o|
|00002a40| 66 20 66 69 6c 65 20 66 | 72 6f 6d 20 7b 5c 73 6c |f file f|rom {\sl|
|00002a50| 20 6f 6c 64 7d 20 74 6f | 20 7b 5c 73 6c 20 6e 65 | old} to| {\sl ne|
|00002a60| 77 7d 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |w}.}..\f|unction{|
|00002a70| 76 6f 69 64 20 72 65 77 | 69 6e 64 28 46 49 4c 45 |void rew|ind(FILE|
|00002a80| 20 5c 2a 66 70 29 3b 7d | 0a 5c 65 78 70 6c 7b 52 | \*fp);}|.\expl{R|
|00002a90| 65 73 65 74 20 74 68 65 | 20 66 69 6c 65 70 6f 69 |eset the| filepoi|
|00002aa0| 6e 74 65 72 20 66 72 6f | 6d 20 73 74 72 65 61 6d |nter fro|m stream|
|00002ab0| 20 7b 5c 73 6c 20 66 70 | 7d 20 74 6f 20 70 6f 73 | {\sl fp|} to pos|
|00002ac0| 69 74 69 6f 6e 20 30 2e | 7d 0a 0a 5c 66 75 6e 63 |ition 0.|}..\func|
|00002ad0| 74 69 6f 6e 7b 69 6e 74 | 20 73 63 61 6e 66 28 63 |tion{int| scanf(c|
|00002ae0| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 66 6d 74 2c |onst~cha|r \*fmt,|
|00002af0| 20 24 5c 6c 64 6f 74 73 | 24 29 3b 7d 0a 5c 66 75 | $\ldots|$);}.\fu|
|00002b00| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 66 73 63 61 6e |nction{i|nt fscan|
|00002b10| 66 28 46 49 4c 45 20 5c | 2a 66 70 2c 20 63 6f 6e |f(FILE \|*fp, con|
|00002b20| 73 74 7e 63 68 61 72 20 | 5c 2a 66 6d 74 2c 20 24 |st~char |\*fmt, $|
|00002b30| 5c 6c 64 6f 74 73 24 29 | 3b 7d 0a 5c 66 75 6e 63 |\ldots$)|;}.\func|
|00002b40| 74 69 6f 6e 7b 69 6e 74 | 20 73 73 63 61 6e 66 28 |tion{int| sscanf(|
|00002b50| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 62 75 66 |const~ch|ar \*buf|
|00002b60| 2c 20 63 6f 6e 73 74 7e | 63 68 61 72 20 5c 2a 66 |, const~|char \*f|
|00002b70| 6d 74 2c 20 24 5c 6c 64 | 6f 74 73 24 29 3b 7d 0a |mt, $\ld|ots$);}.|
|00002b80| 5c 65 78 70 6c 7b 46 6f | 72 6d 61 74 65 64 20 69 |\expl{Fo|rmated i|
|00002b90| 6e 70 75 74 20 66 72 6f | 6d 20 65 69 74 68 65 72 |nput fro|m either|
|00002ba0| 20 5c 3c 73 74 64 69 6e | 3e 2c 20 7b 5c 73 6c 20 | \<stdin|>, {\sl |
|00002bb0| 66 70 7d 20 6f 72 20 7b | 5c 73 6c 20 62 75 66 7d |fp} or {|\sl buf}|
|00002bc0| 2e 20 28 46 6f 72 0a 61 | 20 64 65 73 63 72 69 70 |. (For.a| descrip|
|00002bd0| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 6c 65 74 74 |tion of |the lett|
|00002be0| 65 72 73 20 69 6e 20 74 | 68 65 20 7b 5c 73 6c 20 |ers in t|he {\sl |
|00002bf0| 66 6d 74 7d 20 73 74 72 | 69 6e 67 20 73 65 65 20 |fmt} str|ing see |
|00002c00| 7b 5c 62 66 20 70 72 69 | 6e 74 66 7d 2e 29 7d 0a |{\bf pri|ntf}.)}.|
|00002c10| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 76 6f 69 64 20 |.\functi|on{void |
|00002c20| 73 65 74 62 75 66 28 46 | 49 4c 45 20 5c 2a 66 70 |setbuf(F|ILE \*fp|
|00002c30| 2c 20 63 68 61 72 20 5c | 2a 62 75 66 29 3b 7d 0a |, char \|*buf);}.|
|00002c40| 5c 65 78 70 6c 7b 53 65 | 74 20 62 75 66 66 65 72 |\expl{Se|t buffer|
|00002c50| 20 6f 66 20 73 74 72 65 | 61 6d 20 7b 5c 73 6c 20 | of stre|am {\sl |
|00002c60| 66 70 7d 20 74 6f 20 7b | 5c 73 6c 20 62 75 66 7d |fp} to {|\sl buf}|
|00002c70| 2e 7d 0a 0a 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |.}..The |followin|
|00002c80| 67 20 66 75 6e 63 74 69 | 6f 6e 73 20 61 72 65 20 |g functi|ons are |
|00002c90| 64 65 66 69 6e 65 64 20 | 61 73 20 6d 61 63 72 6f |defined |as macro|
|00002ca0| 73 2e 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |s...\fun|ction{in|
|00002cb0| 74 20 73 65 74 76 62 75 | 66 28 46 49 4c 45 20 5c |t setvbu|f(FILE \|
|00002cc0| 2a 66 70 2c 20 63 68 61 | 72 20 5c 2a 62 75 66 2c |*fp, cha|r \*buf,|
|00002cd0| 20 69 6e 74 20 6d 6f 64 | 65 2c 20 73 69 7a 65 5c | int mod|e, size\|
|00002ce0| 5f 74 20 73 7a 29 3b 7d | 0a 5c 65 78 70 6c 7b 53 |_t sz);}|.\expl{S|
|00002cf0| 65 74 20 62 75 66 66 65 | 72 20 6f 66 20 73 74 72 |et buffe|r of str|
|00002d00| 65 61 6d 20 7b 5c 73 6c | 20 66 70 7d 20 74 6f 20 |eam {\sl| fp} to |
|00002d10| 7b 5c 73 6c 20 62 75 66 | 7d 20 77 69 74 68 20 73 |{\sl buf|} with s|
|00002d20| 69 7a 65 20 7b 5c 73 6c | 20 73 7a 7d 20 61 6e 64 |ize {\sl| sz} and|
|00002d30| 0a 6d 6f 64 65 20 7b 5c | 73 6c 20 6d 6f 64 65 7d |.mode {\|sl mode}|
|00002d40| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 46 49 |.}..\fun|ction{FI|
|00002d50| 4c 45 20 5c 2a 74 6d 70 | 66 69 6c 65 28 76 6f 69 |LE \*tmp|file(voi|
|00002d60| 64 29 3b 7d 0a 5c 65 78 | 70 6c 7b 43 72 65 61 74 |d);}.\ex|pl{Creat|
|00002d70| 65 20 61 20 74 65 6d 70 | 6f 72 61 72 79 20 66 69 |e a temp|orary fi|
|00002d80| 6c 65 2e 20 46 69 6c 65 | 20 69 73 20 64 65 6c 65 |le. File| is dele|
|00002d90| 74 65 64 20 6f 6e 20 6e | 6f 72 6d 61 6c 20 74 65 |ted on n|ormal te|
|00002da0| 72 6d 69 6e 61 74 69 6f | 6e 2e 7d 0a 0a 5c 66 75 |rminatio|n.}..\fu|
|00002db0| 6e 63 74 69 6f 6e 7b 63 | 68 61 72 20 5c 2a 74 6d |nction{c|har \*tm|
|00002dc0| 70 6e 61 6d 28 63 68 61 | 72 20 5c 2a 62 75 66 29 |pnam(cha|r \*buf)|
|00002dd0| 3b 7d 0a 5c 65 78 70 6c | 7b 43 72 65 61 74 65 20 |;}.\expl|{Create |
|00002de0| 61 20 73 74 72 69 6e 67 | 20 66 6f 72 20 61 20 74 |a string| for a t|
|00002df0| 65 6d 70 6f 72 61 72 79 | 20 66 69 6c 65 6e 61 6d |emporary| filenam|
|00002e00| 65 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 76 |e.}..\fu|nction{v|
|00002e10| 6f 69 64 20 5c 5f 62 69 | 6e 6d 6f 64 65 28 69 6e |oid \_bi|nmode(in|
|00002e20| 74 20 62 6f 6f 6c 29 3b | 7d 0a 5c 65 78 70 6c 7b |t bool);|}.\expl{|
|00002e30| 53 65 74 20 64 65 66 61 | 75 6c 74 20 6f 70 65 6e |Set defa|ult open|
|00002e40| 20 6d 6f 64 65 20 74 6f | 20 62 69 6e 61 72 79 20 | mode to| binary |
|00002e50| 28 62 6f 6f 6c 20 3d 20 | 74 72 75 65 29 20 6f 72 |(bool = |true) or|
|00002e60| 20 74 65 78 74 2e 7d 0a | 0a 25 25 25 25 25 25 25 | text.}.|.%%%%%%%|
|00002e70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002e80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002e90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002ea0| 25 25 25 25 25 0a 0c 0a | 5c 73 65 63 74 69 6f 6e |%%%%%...|\section|
|00002eb0| 7b 49 2f 4f 20 43 6f 6e | 74 72 6f 6c 7d 0a 0a 5c |{I/O Con|trol}..\|
|00002ec0| 23 69 6e 63 6c 75 64 65 | 20 5c 3c 69 6f 63 74 6c |#include| \<ioctl|
|00002ed0| 2e 68 3e 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 69 |.h>..\fu|nction{i|
|00002ee0| 6e 74 20 69 6f 63 74 6c | 28 69 6e 74 20 66 64 2c |nt ioctl|(int fd,|
|00002ef0| 20 69 6e 74 20 63 6d 64 | 2c 20 76 6f 69 64 20 5c | int cmd|, void \|
|00002f00| 2a 61 72 67 29 3b 7d 0a | 5c 65 78 70 6c 7b 53 65 |*arg);}.|\expl{Se|
|00002f10| 74 20 6f 72 20 69 6e 71 | 75 69 72 65 20 69 2f 6f |t or inq|uire i/o|
|00002f20| 20 64 65 70 65 6e 64 65 | 6e 64 20 70 61 72 61 6d | depende|nd param|
|00002f30| 65 74 65 72 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |eter.}..|\functio|
|00002f40| 6e 7b 69 6e 74 20 73 74 | 74 79 28 69 6e 74 20 66 |n{int st|ty(int f|
|00002f50| 64 2c 20 73 74 72 75 63 | 74 20 73 67 74 74 79 62 |d, struc|t sgttyb|
|00002f60| 20 5c 2a 5c 5f 74 74 79 | 29 3b 7d 0a 5c 66 75 6e | \*\_tty|);}.\fun|
|00002f70| 63 74 69 6f 6e 7b 69 6e | 74 20 67 74 74 79 28 69 |ction{in|t gtty(i|
|00002f80| 6e 74 20 66 64 2c 20 73 | 74 72 75 63 74 20 73 67 |nt fd, s|truct sg|
|00002f90| 74 74 79 62 20 5c 2a 5c | 5f 74 74 79 29 3b 7d 0a |ttyb \*\|_tty);}.|
|00002fa0| 5c 65 78 70 6c 7b 53 65 | 74 20 6f 72 20 69 6e 71 |\expl{Se|t or inq|
|00002fb0| 75 69 72 65 20 69 2f 6f | 20 70 61 72 61 6d 65 74 |uire i/o| paramet|
|00002fc0| 65 72 73 20 66 6f 72 20 | 64 65 73 63 72 69 70 74 |ers for |descript|
|00002fd0| 6f 72 20 7b 5c 73 6c 20 | 66 64 7d 2e 7d 0a 5c 6d |or {\sl |fd}.}.\m|
|00002fe0| 65 64 73 6b 69 70 0a 5c | 23 69 6e 63 6c 75 64 65 |edskip.\|#include|
|00002ff0| 20 5c 3c 66 63 6e 74 6c | 2e 68 3e 0a 0a 5c 66 75 | \<fcntl|.h>..\fu|
|00003000| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 66 63 6e 74 6c |nction{i|nt fcntl|
|00003010| 28 69 6e 74 20 66 64 2c | 20 69 6e 74 20 63 6d 64 |(int fd,| int cmd|
|00003020| 2c 20 24 5c 6c 64 6f 74 | 73 24 29 3b 7d 0a 5c 65 |, $\ldot|s$);}.\e|
|00003030| 78 70 6c 7b 53 65 74 20 | 6f 72 20 69 6e 71 75 69 |xpl{Set |or inqui|
|00003040| 72 65 20 66 69 6c 65 20 | 69 2f 6f 20 64 65 70 65 |re file |i/o depe|
|00003050| 6e 64 65 6e 64 20 70 61 | 72 61 6d 65 74 65 72 20 |ndend pa|rameter |
|00003060| 28 4d 69 4e 54 29 2e 7d | 0a 0a 25 25 25 25 25 25 |(MiNT).}|..%%%%%%|
|00003070| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003080| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003090| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000030a0| 25 25 25 25 25 25 0a 0c | 0a 5c 73 65 63 74 69 6f |%%%%%%..|.\sectio|
|000030b0| 6e 7b 4d 65 6d 6f 72 79 | 20 4d 61 6e 61 67 65 6d |n{Memory| Managem|
|000030c0| 65 6e 74 7d 0a 0a 5c 23 | 69 6e 63 6c 75 64 65 20 |ent}..\#|include |
|000030d0| 5c 3c 73 74 64 6c 69 62 | 2e 68 3e 0a 0a 5c 66 75 |\<stdlib|.h>..\fu|
|000030e0| 6e 63 74 69 6f 6e 7b 76 | 6f 69 64 20 5c 2a 63 61 |nction{v|oid \*ca|
|000030f0| 6c 6c 6f 63 28 73 69 7a | 65 5c 5f 74 20 6e 6f 2c |lloc(siz|e\_t no,|
|00003100| 20 73 69 7a 65 5c 5f 74 | 20 73 7a 29 3b 7d 0a 5c | size\_t| sz);}.\|
|00003110| 65 78 70 6c 7b 41 6c 6c | 6f 63 61 74 65 20 61 6e |expl{All|ocate an|
|00003120| 64 20 69 6e 69 74 69 61 | 6c 69 7a 65 20 6d 65 6d |d initia|lize mem|
|00003130| 6f 72 79 20 66 6f 72 20 | 7b 5c 73 6c 20 6e 6f 7d |ory for |{\sl no}|
|00003140| 20 69 74 65 6d 73 20 6f | 66 20 73 69 7a 65 20 7b | items o|f size {|
|00003150| 5c 73 6c 20 73 69 7a 65 | 7d 2e 7d 0a 0a 5c 66 75 |\sl size|}.}..\fu|
|00003160| 6e 63 74 69 6f 6e 7b 76 | 6f 69 64 20 5c 2a 6d 61 |nction{v|oid \*ma|
|00003170| 6c 6c 6f 63 28 73 69 7a | 65 5c 5f 74 20 73 7a 29 |lloc(siz|e\_t sz)|
|00003180| 3b 7d 0a 5c 65 78 70 6c | 7b 41 6c 6c 6f 63 61 74 |;}.\expl|{Allocat|
|00003190| 65 20 7b 5c 73 6c 20 73 | 7a 7d 20 62 79 74 65 73 |e {\sl s|z} bytes|
|000031a0| 20 6f 66 20 6d 65 6d 6f | 72 79 2e 7d 0a 0a 5c 66 | of memo|ry.}..\f|
|000031b0| 75 6e 63 74 69 6f 6e 7b | 76 6f 69 64 20 5c 2a 72 |unction{|void \*r|
|000031c0| 65 61 6c 6c 6f 63 28 76 | 6f 69 64 20 5c 2a 70 74 |ealloc(v|oid \*pt|
|000031d0| 72 2c 20 73 69 7a 65 5c | 5f 74 20 73 7a 29 3b 7d |r, size\|_t sz);}|
|000031e0| 0a 5c 65 78 70 6c 7b 52 | 65 73 69 7a 65 20 6d 65 |.\expl{R|esize me|
|000031f0| 6d 6f 72 79 20 70 6f 69 | 6e 74 65 64 20 74 6f 20 |mory poi|nted to |
|00003200| 62 79 20 7b 5c 73 6c 20 | 70 74 72 7d 20 74 6f 20 |by {\sl |ptr} to |
|00003210| 73 69 7a 65 20 7b 5c 73 | 6c 20 73 7a 7d 2e 7d 0a |size {\s|l sz}.}.|
|00003220| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 76 6f 69 64 20 |.\functi|on{void |
|00003230| 66 72 65 65 28 76 6f 69 | 64 20 5c 2a 70 74 72 29 |free(voi|d \*ptr)|
|00003240| 3b 7d 0a 5c 65 78 70 6c | 7b 46 72 65 65 20 6d 65 |;}.\expl|{Free me|
|00003250| 6d 6f 72 79 20 6f 62 74 | 61 69 6e 65 64 20 62 79 |mory obt|ained by|
|00003260| 20 7b 5c 62 66 20 63 61 | 6c 6c 6f 63 7d 2c 20 7b | {\bf ca|lloc}, {|
|00003270| 5c 62 66 20 6d 61 6c 6c | 6f 63 7d 20 6f 72 20 7b |\bf mall|oc} or {|
|00003280| 5c 62 66 20 72 65 61 6c | 6c 6f 63 7d 2e 7d 0a 0a |\bf real|loc}.}..|
|00003290| 5c 66 75 6e 63 74 69 6f | 6e 7b 76 6f 69 64 20 5c |\functio|n{void \|
|000032a0| 2a 61 6c 6c 6f 63 61 28 | 73 69 7a 65 5c 5f 74 20 |*alloca(|size\_t |
|000032b0| 73 7a 29 3b 7d 0a 5c 65 | 78 70 6c 7b 41 6c 6c 6f |sz);}.\e|xpl{Allo|
|000032c0| 63 61 74 65 20 7b 5c 73 | 6c 20 73 7a 7d 20 62 79 |cate {\s|l sz} by|
|000032d0| 74 65 73 20 66 72 6f 6d | 20 74 68 65 20 63 75 72 |tes from| the cur|
|000032e0| 72 65 6e 74 20 66 75 6e | 63 74 69 6f 6e 20 73 74 |rent fun|ction st|
|000032f0| 61 63 6b 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ack.}..\|function|
|00003300| 7b 76 6f 69 64 20 5c 5f | 6d 61 6c 6c 6f 63 7a 65 |{void \_|mallocze|
|00003310| 72 6f 28 69 6e 74 20 62 | 6f 6f 6c 29 3b 7d 0a 5c |ro(int b|ool);}.\|
|00003320| 65 78 70 6c 7b 5a 65 72 | 6f 20 61 6c 6c 6f 63 61 |expl{Zer|o alloca|
|00003330| 74 65 64 20 6d 65 6d 6f | 72 79 20 62 6c 6f 63 6b |ted memo|ry block|
|00003340| 73 2e 20 44 65 66 61 75 | 6c 74 20 24 3d 3d 24 20 |s. Defau|lt $==$ |
|00003350| 66 61 6c 73 65 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 |false.}.|.\functi|
|00003360| 6f 6e 7b 76 6f 69 64 20 | 5c 5f 6d 61 6c 6c 6f 63 |on{void |\_malloc|
|00003370| 43 68 75 6e 6b 53 69 7a | 65 28 73 69 7a 65 5c 5f |ChunkSiz|e(size\_|
|00003380| 74 20 53 69 7a 29 3b 7d | 0a 5c 65 78 70 6c 7b 47 |t Siz);}|.\expl{G|
|00003390| 65 74 20 6d 65 6d 6f 72 | 79 20 66 72 6f 6d 20 4f |et memor|y from O|
|000033a0| 53 20 69 6e 20 61 74 6c | 65 61 73 74 20 7b 5c 73 |S in atl|east {\s|
|000033b0| 6c 20 53 69 7a 7d 20 73 | 69 7a 65 64 20 62 6c 6f |l Siz} s|ized blo|
|000033c0| 63 6b 73 2e 20 44 65 66 | 61 75 6c 74 0a 24 3d 3d |cks. Def|ault.$==|
|000033d0| 24 20 34 4b 7d 0a 5c 6d | 65 64 73 6b 69 70 0a 5c |$ 4K}.\m|edskip.\|
|000033e0| 23 69 6e 63 6c 75 64 65 | 20 5c 3c 6d 65 6d 6f 72 |#include| \<memor|
|000033f0| 79 2e 68 3e 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |y.h>..\f|unction{|
|00003400| 76 6f 69 64 20 5c 2a 5c | 5f 63 61 6c 6c 6f 63 28 |void \*\|_calloc(|
|00003410| 75 6e 73 69 67 6e 65 64 | 7e 6c 6f 6e 67 20 6e 6f |unsigned|~long no|
|00003420| 2c 20 75 6e 73 69 67 6e | 65 64 7e 6c 6f 6e 67 20 |, unsign|ed~long |
|00003430| 73 7a 29 3b 7d 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |sz);}.\f|unction{|
|00003440| 76 6f 69 64 20 5c 2a 5c | 5f 6d 61 6c 6c 6f 63 28 |void \*\|_malloc(|
|00003450| 75 6e 73 69 67 6e 65 64 | 7e 6c 6f 6e 67 20 73 7a |unsigned|~long sz|
|00003460| 29 3b 7d 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 76 6f |);}.\fun|ction{vo|
|00003470| 69 64 20 5c 2a 5c 5f 72 | 65 61 6c 6c 6f 63 28 76 |id \*\_r|ealloc(v|
|00003480| 6f 69 64 20 5c 2a 70 74 | 72 2c 20 75 6e 73 69 67 |oid \*pt|r, unsig|
|00003490| 6e 65 64 7e 6c 6f 6e 67 | 20 73 7a 29 3b 7d 0a 5c |ned~long| sz);}.\|
|000034a0| 65 78 70 6c 7b 41 70 61 | 72 74 20 66 72 6f 6d 20 |expl{Apa|rt from |
|000034b0| 74 68 65 20 61 62 6f 76 | 65 20 66 75 6e 63 74 69 |the abov|e functi|
|000034c0| 6f 6e 73 2c 20 74 68 65 | 73 65 20 74 68 72 65 65 |ons, the|se three|
|000034d0| 20 66 75 6e 63 74 69 6f | 6e 73 20 61 72 65 0a 61 | functio|ns are.a|
|000034e0| 64 64 69 74 69 6f 6e 61 | 6c 6c 79 20 64 65 63 6c |dditiona|lly decl|
|000034f0| 61 72 65 64 20 69 6e 20 | 6d 65 6d 6f 72 79 2e 68 |ared in |memory.h|
|00003500| 20 61 6e 64 20 74 61 6b | 65 20 7b 5c 73 6c 20 6c | and tak|e {\sl l|
|00003510| 6f 6e 67 7d 20 61 72 67 | 75 6d 65 6e 74 73 2e 7d |ong} arg|uments.}|
|00003520| 0a 0a 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |..%%%%%%|%%%%%%%%|
|00003530| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003540| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003550| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 0a 0c |%%%%%%%%|%%%%%%..|
|00003560| 0a 5c 73 65 63 74 69 6f | 6e 7b 43 68 61 72 61 63 |.\sectio|n{Charac|
|00003570| 74 65 72 20 43 6c 61 73 | 73 69 66 69 63 61 74 69 |ter Clas|sificati|
|00003580| 6f 6e 20 61 6e 64 20 43 | 6f 6e 76 65 72 73 69 6f |on and C|onversio|
|00003590| 6e 7d 0a 0a 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |n}..The |followin|
|000035a0| 67 20 66 75 6e 63 74 69 | 6f 6e 73 20 72 65 74 75 |g functi|ons retu|
|000035b0| 72 6e 20 24 5c 6e 65 24 | 20 30 2c 20 69 66 20 63 |rn $\ne$| 0, if c|
|000035c0| 68 61 72 61 63 74 65 72 | 20 7b 5c 73 6c 20 63 7d |haracter| {\sl c}|
|000035d0| 20 62 65 6c 6f 6e 67 73 | 0a 74 6f 20 74 68 65 20 | belongs|.to the |
|000035e0| 73 70 65 63 69 66 69 65 | 64 20 63 68 61 72 61 63 |specifie|d charac|
|000035f0| 74 65 72 20 73 65 74 3b | 20 30 20 6f 74 68 65 72 |ter set;| 0 other|
|00003600| 77 69 73 65 2e 0a 0a 5c | 23 69 6e 63 6c 75 64 65 |wise...\|#include|
|00003610| 20 5c 3c 63 74 79 70 65 | 2e 68 3e 0a 0a 5c 70 61 | \<ctype|.h>..\pa|
|00003620| 72 61 6c 69 67 6e 7b 7b | 5c 62 66 20 23 7d 28 7b |ralign{{|\bf #}({|
|00003630| 5c 73 6c 20 63 7d 29 5c | 68 66 69 6c 5c 71 75 61 |\sl c})\|hfil\qua|
|00003640| 64 26 23 5c 68 66 69 6c | 5c 63 72 0a 20 20 5c 6f |d&#\hfil|\cr. \o|
|00003650| 6d 69 74 5c 72 6d 20 66 | 75 6e 63 74 69 6f 6e 5c |mit\rm f|unction\|
|00003660| 68 66 69 6c 5c 71 75 61 | 64 26 73 65 74 5c 63 72 |hfil\qua|d&set\cr|
|00003670| 5c 6e 6f 61 6c 69 67 6e | 7b 5c 76 73 6b 69 70 20 |\noalign|{\vskip |
|00003680| 33 70 74 7d 0a 20 20 5c | 74 77 6f 63 6f 6c 7b 69 |3pt}. \|twocol{i|
|00003690| 73 61 6c 6e 75 6d 7d 7b | 4c 65 74 74 65 72 20 6f |salnum}{|Letter o|
|000036a0| 72 20 44 69 67 69 74 7d | 0a 20 20 5c 74 77 6f 63 |r Digit}|. \twoc|
|000036b0| 6f 6c 7b 69 73 61 6c 70 | 68 61 7d 7b 4c 65 74 74 |ol{isalp|ha}{Lett|
|000036c0| 65 72 7d 0a 20 20 5c 74 | 77 6f 63 6f 6c 7b 69 73 |er}. \t|wocol{is|
|000036d0| 61 73 63 69 69 7d 7b 41 | 53 43 49 49 20 63 68 61 |ascii}{A|SCII cha|
|000036e0| 72 61 63 74 65 72 20 28 | 43 6f 64 65 73 3a 20 30 |racter (|Codes: 0|
|000036f0| 24 5c 6c 64 6f 74 73 24 | 30 31 37 37 29 7d 0a 20 |$\ldots$|0177)}. |
|00003700| 20 5c 74 77 6f 63 6f 6c | 7b 69 73 63 6e 74 72 6c | \twocol|{iscntrl|
|00003710| 7d 7b 43 6f 6e 74 72 6f | 6c 20 63 68 61 72 61 63 |}{Contro|l charac|
|00003720| 74 65 72 20 28 43 6f 64 | 65 73 3a 20 30 24 5c 6c |ter (Cod|es: 0$\l|
|00003730| 64 6f 74 73 24 30 33 37 | 2c 20 30 31 37 37 29 7d |dots$037|, 0177)}|
|00003740| 0a 20 20 5c 74 77 6f 63 | 6f 6c 7b 69 73 64 69 67 |. \twoc|ol{isdig|
|00003750| 69 74 7d 7b 44 69 67 69 | 74 7d 0a 20 20 5c 74 77 |it}{Digi|t}. \tw|
|00003760| 6f 63 6f 6c 7b 69 73 67 | 72 61 70 68 7d 7b 50 72 |ocol{isg|raph}{Pr|
|00003770| 69 6e 74 61 62 6c 65 20 | 63 68 61 72 61 63 74 65 |intable |characte|
|00003780| 72 20 65 78 63 65 70 74 | 20 73 70 61 63 65 7d 0a |r except| space}.|
|00003790| 20 20 5c 74 77 6f 63 6f | 6c 7b 69 73 6c 6f 77 65 | \twoco|l{islowe|
|000037a0| 72 7d 7b 4c 6f 77 65 72 | 63 61 73 65 20 6c 65 74 |r}{Lower|case let|
|000037b0| 74 65 72 7d 0a 20 20 5c | 74 77 6f 63 6f 6c 7b 69 |ter}. \|twocol{i|
|000037c0| 73 70 72 69 6e 74 7d 7b | 50 72 69 6e 74 61 62 6c |sprint}{|Printabl|
|000037d0| 65 20 63 68 61 72 61 63 | 74 65 72 7d 0a 20 20 5c |e charac|ter}. \|
|000037e0| 74 77 6f 63 6f 6c 7b 69 | 73 70 75 6e 63 74 7d 7b |twocol{i|spunct}{|
|000037f0| 50 75 6e 63 74 75 61 74 | 69 6f 6e 20 63 68 61 72 |Punctuat|ion char|
|00003800| 2e 20 28 6e 6f 74 20 6c | 65 74 74 65 72 2c 20 64 |. (not l|etter, d|
|00003810| 69 67 69 74 20 6f 72 20 | 63 6f 6e 74 72 6f 6c 29 |igit or |control)|
|00003820| 7d 0a 20 20 5c 74 77 6f | 63 6f 6c 7b 69 73 73 70 |}. \two|col{issp|
|00003830| 61 63 65 7d 7b 53 70 61 | 63 65 2c 20 54 61 62 2c |ace}{Spa|ce, Tab,|
|00003840| 20 43 52 2c 20 4e 4c 2c | 20 56 54 2c 20 46 46 20 | CR, NL,| VT, FF |
|00003850| 6f 72 20 42 53 7d 0a 20 | 20 5c 74 77 6f 63 6f 6c |or BS}. | \twocol|
|00003860| 7b 69 73 75 70 70 65 72 | 7d 7b 55 70 70 65 72 63 |{isupper|}{Upperc|
|00003870| 61 73 65 20 6c 65 74 74 | 65 72 7d 0a 20 20 5c 74 |ase lett|er}. \t|
|00003880| 77 6f 63 6f 6c 7b 69 73 | 78 64 69 67 69 74 7d 7b |wocol{is|xdigit}{|
|00003890| 48 65 78 61 64 65 63 69 | 6d 61 6c 20 64 69 67 69 |Hexadeci|mal digi|
|000038a0| 74 7d 0a 20 20 5c 74 77 | 6f 63 6f 6c 7b 69 73 77 |t}. \tw|ocol{isw|
|000038b0| 68 69 74 65 7d 7b 73 61 | 6d 65 20 61 73 20 69 73 |hite}{sa|me as is|
|000038c0| 70 61 63 65 28 29 7d 0a | 20 20 5c 74 77 6f 63 6f |pace()}.| \twoco|
|000038d0| 6c 7b 69 73 6f 64 69 67 | 69 74 7d 7b 4f 63 74 61 |l{isodig|it}{Octa|
|000038e0| 6c 20 64 69 67 69 74 7d | 0a 20 20 5c 74 77 6f 63 |l digit}|. \twoc|
|000038f0| 6f 6c 7b 69 73 63 79 6d | 66 7d 7b 43 68 61 72 61 |ol{iscym|f}{Chara|
|00003900| 63 74 65 72 20 73 74 61 | 72 74 69 6e 67 20 61 20 |cter sta|rting a |
|00003910| 43 20 69 64 65 6e 74 69 | 66 69 65 72 7d 0a 20 20 |C identi|fier}. |
|00003920| 5c 74 77 6f 63 6f 6c 7b | 69 73 63 79 6d 7d 7b 43 |\twocol{|iscym}{C|
|00003930| 68 61 72 61 63 74 65 72 | 73 20 63 6f 6e 74 69 6e |haracter|s contin|
|00003940| 75 69 6e 67 20 61 20 43 | 20 69 64 65 6e 74 69 66 |uing a C| identif|
|00003950| 69 65 72 7d 0a 7d 0a 0a | 43 68 61 72 61 63 74 65 |ier}.}..|Characte|
|00003960| 72 20 63 6f 6e 76 65 72 | 73 69 6f 6e 20 66 75 6e |r conver|sion fun|
|00003970| 63 74 69 6f 6e 73 0a 0a | 5c 70 61 72 61 6c 69 67 |ctions..|\paralig|
|00003980| 6e 7b 7b 5c 62 66 20 23 | 7d 28 7b 5c 73 6c 20 63 |n{{\bf #|}({\sl c|
|00003990| 7d 29 5c 68 66 69 6c 5c | 71 75 61 64 26 23 5c 68 |})\hfil\|quad&#\h|
|000039a0| 66 69 6c 5c 63 72 0a 20 | 20 5c 6f 6d 69 74 5c 72 |fil\cr. | \omit\r|
|000039b0| 6d 20 66 75 6e 63 74 69 | 6f 6e 5c 68 66 69 6c 5c |m functi|on\hfil\|
|000039c0| 71 75 61 64 26 4d 65 61 | 6e 69 6e 67 5c 63 72 5c |quad&Mea|ning\cr\|
|000039d0| 6e 6f 61 6c 69 67 6e 7b | 5c 76 73 6b 69 70 20 33 |noalign{|\vskip 3|
|000039e0| 70 74 7d 0a 20 20 5c 74 | 77 6f 63 6f 6c 7b 74 6f |pt}. \t|wocol{to|
|000039f0| 75 70 70 65 72 7d 7b 43 | 6f 6e 76 65 72 74 20 74 |upper}{C|onvert t|
|00003a00| 6f 20 75 70 70 65 72 63 | 61 73 65 20 6c 65 74 74 |o upperc|ase lett|
|00003a10| 65 72 7d 0a 20 20 5c 74 | 77 6f 63 6f 6c 7b 5c 5f |er}. \t|wocol{\_|
|00003a20| 74 6f 75 70 70 65 72 7d | 7b 43 6f 6e 76 65 72 74 |toupper}|{Convert|
|00003a30| 20 74 6f 20 75 70 70 65 | 72 63 61 73 65 20 6c 65 | to uppe|rcase le|
|00003a40| 74 74 65 72 20 28 6d 61 | 63 72 6f 29 7d 0a 20 20 |tter (ma|cro)}. |
|00003a50| 5c 74 77 6f 63 6f 6c 7b | 74 6f 6c 6f 77 65 72 7d |\twocol{|tolower}|
|00003a60| 7b 43 6f 6e 76 65 72 74 | 20 74 6f 20 6c 6f 77 65 |{Convert| to lowe|
|00003a70| 72 63 61 73 65 20 6c 65 | 74 74 65 72 7d 0a 20 20 |rcase le|tter}. |
|00003a80| 5c 74 77 6f 63 6f 6c 7b | 5c 5f 74 6f 6c 6f 77 65 |\twocol{|\_tolowe|
|00003a90| 72 7d 7b 43 6f 6e 76 65 | 72 74 20 74 6f 20 6c 6f |r}{Conve|rt to lo|
|00003aa0| 77 65 72 63 61 73 65 20 | 6c 65 74 74 65 72 20 28 |wercase |letter (|
|00003ab0| 6d 61 63 72 6f 29 7d 0a | 20 20 5c 74 77 6f 63 6f |macro)}.| \twoco|
|00003ac0| 6c 7b 74 6f 69 6e 74 7d | 7b 43 6f 6e 76 65 72 74 |l{toint}|{Convert|
|00003ad0| 20 64 69 67 69 74 20 74 | 6f 20 69 6e 74 65 67 65 | digit t|o intege|
|00003ae0| 72 7d 0a 7d 0a 0a 25 25 | 25 25 25 25 25 25 25 25 |r}.}..%%|%%%%%%%%|
|00003af0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003b00| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003b10| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003b20| 25 25 0a 0c 0a 5c 73 65 | 63 74 69 6f 6e 7b 53 74 |%%...\se|ction{St|
|00003b30| 72 69 6e 67 20 48 61 6e | 64 6c 69 6e 67 7d 0a 0a |ring Han|dling}..|
|00003b40| 5c 23 69 6e 63 6c 75 64 | 65 20 5c 3c 73 74 72 69 |\#includ|e \<stri|
|00003b50| 6e 67 2e 68 3e 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ng.h>..\|function|
|00003b60| 7b 69 6e 74 20 62 63 6d | 70 28 63 6f 6e 73 74 7e |{int bcm|p(const~|
|00003b70| 76 6f 69 64 20 5c 2a 70 | 74 72 31 2c 20 63 6f 6e |void \*p|tr1, con|
|00003b80| 73 74 7e 76 6f 69 64 20 | 5c 2a 70 74 72 32 2c 20 |st~void |\*ptr2, |
|00003b90| 73 69 7a 65 5c 5f 74 20 | 6e 6f 29 3b 7d 0a 5c 65 |size\_t |no);}.\e|
|00003ba0| 78 70 6c 7b 43 6f 6d 70 | 61 72 65 20 7b 5c 73 6c |xpl{Comp|are {\sl|
|00003bb0| 20 6e 6f 7d 20 6f 66 20 | 62 79 74 65 73 20 61 74 | no} of |bytes at|
|00003bc0| 20 70 6f 73 69 74 69 6f | 6e 20 7b 5c 73 6c 20 70 | positio|n {\sl p|
|00003bd0| 74 72 31 7d 20 77 69 74 | 68 20 7b 5c 73 6c 20 70 |tr1} wit|h {\sl p|
|00003be0| 74 72 32 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |tr2}.}..|\functio|
|00003bf0| 6e 7b 76 6f 69 64 20 62 | 63 6f 70 79 28 63 6f 6e |n{void b|copy(con|
|00003c00| 73 74 7e 76 6f 69 64 20 | 5c 2a 73 72 63 2c 20 76 |st~void |\*src, v|
|00003c10| 6f 69 64 20 5c 2a 64 73 | 74 2c 20 73 69 7a 65 5c |oid \*ds|t, size\|
|00003c20| 5f 74 20 6c 65 6e 29 3b | 7d 0a 5c 65 78 70 6c 7b |_t len);|}.\expl{|
|00003c30| 43 6f 70 79 20 7b 5c 73 | 6c 20 6c 65 6e 7d 20 62 |Copy {\s|l len} b|
|00003c40| 79 74 65 73 20 66 72 6f | 6d 20 70 6f 73 69 74 69 |ytes fro|m positi|
|00003c50| 6f 6e 20 7b 5c 73 6c 20 | 73 72 63 7d 20 74 6f 20 |on {\sl |src} to |
|00003c60| 7b 5c 73 6c 20 64 73 74 | 7d 2e 7d 0a 0a 5c 66 75 |{\sl dst|}.}..\fu|
|00003c70| 6e 63 74 69 6f 6e 7b 76 | 6f 69 64 20 62 7a 65 72 |nction{v|oid bzer|
|00003c80| 6f 28 76 6f 69 64 20 5c | 2a 64 73 74 2c 20 73 69 |o(void \|*dst, si|
|00003c90| 7a 65 5c 5f 74 20 6c 65 | 6e 29 3b 7d 0a 5c 65 78 |ze\_t le|n);}.\ex|
|00003ca0| 70 6c 7b 53 65 74 20 7b | 5c 73 6c 20 6c 65 6e 7d |pl{Set {|\sl len}|
|00003cb0| 20 62 79 74 65 73 20 61 | 74 20 70 6f 73 69 74 69 | bytes a|t positi|
|00003cc0| 6f 6e 20 7b 5c 73 6c 20 | 64 73 74 7d 20 74 6f 20 |on {\sl |dst} to |
|00003cd0| 30 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 63 |0.}..\fu|nction{c|
|00003ce0| 68 61 72 20 5c 2a 69 6e | 64 65 78 28 63 6f 6e 73 |har \*in|dex(cons|
|00003cf0| 74 7e 63 68 61 72 20 5c | 2a 73 74 72 2c 20 69 6e |t~char \|*str, in|
|00003d00| 74 20 63 68 61 72 77 29 | 3b 7d 0a 5c 66 75 6e 63 |t charw)|;}.\func|
|00003d10| 74 69 6f 6e 7b 63 68 61 | 72 20 5c 2a 72 69 6e 64 |tion{cha|r \*rind|
|00003d20| 65 78 28 63 6f 6e 73 74 | 7e 63 68 61 72 20 5c 2a |ex(const|~char \*|
|00003d30| 73 74 72 2c 20 69 6e 74 | 20 63 68 61 72 77 29 3b |str, int| charw);|
|00003d40| 7d 0a 5c 65 78 70 6c 7b | 53 61 6d 65 20 61 73 20 |}.\expl{|Same as |
|00003d50| 7b 5c 62 66 20 73 74 72 | 63 68 72 7d 28 29 20 28 |{\bf str|chr}() (|
|00003d60| 7b 5c 62 66 20 73 74 72 | 72 63 68 72 7d 28 29 29 |{\bf str|rchr}())|
|00003d70| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 76 6f |.}..\fun|ction{vo|
|00003d80| 69 64 20 5c 2a 6d 65 6d | 63 63 70 79 28 76 6f 69 |id \*mem|ccpy(voi|
|00003d90| 64 20 5c 2a 64 73 74 2c | 20 63 6f 6e 73 74 7e 76 |d \*dst,| const~v|
|00003da0| 6f 69 64 20 5c 2a 73 72 | 63 2c 20 69 6e 74 20 75 |oid \*sr|c, int u|
|00003db0| 63 68 61 72 73 74 6f 70 | 2c 20 73 69 7a 65 5c 5f |charstop|, size\_|
|00003dc0| 74 20 6e 6f 29 3b 7d 0a | 5c 65 78 70 6c 7b 43 6f |t no);}.|\expl{Co|
|00003dd0| 70 79 20 63 68 61 72 61 | 63 74 65 72 73 20 66 72 |py chara|cters fr|
|00003de0| 6f 6d 20 7b 5c 73 6c 20 | 73 72 63 7d 20 74 6f 20 |om {\sl |src} to |
|00003df0| 7b 5c 73 6c 20 64 73 74 | 7d 20 75 6e 74 69 6c 20 |{\sl dst|} until |
|00003e00| 63 68 61 72 61 63 74 65 | 72 20 7b 5c 73 6c 0a 75 |characte|r {\sl.u|
|00003e10| 63 68 61 72 5c 2d 73 74 | 6f 70 7d 2c 20 62 75 74 |char\-st|op}, but|
|00003e20| 20 63 6f 70 79 20 61 74 | 20 6d 6f 73 74 20 7b 5c | copy at| most {\|
|00003e30| 73 6c 20 6e 6f 7d 20 62 | 79 74 65 73 2e 7d 0a 0a |sl no} b|ytes.}..|
|00003e40| 5c 66 75 6e 63 74 69 6f | 6e 7b 76 6f 69 64 20 5c |\functio|n{void \|
|00003e50| 2a 6d 65 6d 63 68 72 28 | 63 6f 6e 73 74 7e 76 6f |*memchr(|const~vo|
|00003e60| 69 64 20 5c 2a 70 74 72 | 2c 20 69 6e 74 20 75 63 |id \*ptr|, int uc|
|00003e70| 68 61 72 77 61 6e 74 65 | 64 2c 20 73 69 7a 65 5c |harwante|d, size\|
|00003e80| 5f 74 20 6e 6f 29 3b 7d | 0a 5c 65 78 70 6c 7b 46 |_t no);}|.\expl{F|
|00003e90| 69 6e 64 20 63 68 61 72 | 61 63 74 65 72 20 7b 5c |ind char|acter {\|
|00003ea0| 73 6c 20 75 63 68 61 72 | 77 61 6e 74 65 64 7d 20 |sl uchar|wanted} |
|00003eb0| 69 6e 20 61 72 65 61 20 | 61 74 20 7b 5c 73 6c 20 |in area |at {\sl |
|00003ec0| 70 74 72 7d 2c 20 62 75 | 74 0a 63 6f 6d 70 61 72 |ptr}, bu|t.compar|
|00003ed0| 65 20 61 74 20 6d 6f 73 | 74 20 7b 5c 73 6c 20 6e |e at mos|t {\sl n|
|00003ee0| 6f 7d 20 63 68 61 72 61 | 63 74 65 72 2e 7d 0a 0a |o} chara|cter.}..|
|00003ef0| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 6d 65 |\functio|n{int me|
|00003f00| 6d 63 6d 70 28 63 6f 6e | 73 74 7e 76 6f 69 64 20 |mcmp(con|st~void |
|00003f10| 5c 2a 70 74 72 31 2c 20 | 63 6f 6e 73 74 7e 76 6f |\*ptr1, |const~vo|
|00003f20| 69 64 20 5c 2a 70 74 72 | 32 2c 20 73 69 7a 65 5c |id \*ptr|2, size\|
|00003f30| 5f 74 20 6e 6f 29 3b 7d | 0a 5c 65 78 70 6c 7b 43 |_t no);}|.\expl{C|
|00003f40| 6f 6d 70 61 72 65 20 7b | 5c 73 6c 20 6e 6f 7d 20 |ompare {|\sl no} |
|00003f50| 62 79 74 65 73 20 66 72 | 6f 6d 20 6d 65 6d 6f 72 |bytes fr|om memor|
|00003f60| 79 20 61 72 65 61 20 61 | 74 20 7b 5c 73 6c 20 70 |y area a|t {\sl p|
|00003f70| 74 72 31 7d 20 77 69 74 | 68 20 61 72 65 61 0a 61 |tr1} wit|h area.a|
|00003f80| 74 20 7b 5c 73 6c 20 70 | 74 72 32 7d 2e 7d 0a 0a |t {\sl p|tr2}.}..|
|00003f90| 5c 66 75 6e 63 74 69 6f | 6e 7b 76 6f 69 64 20 5c |\functio|n{void \|
|00003fa0| 2a 6d 65 6d 63 70 79 28 | 76 6f 69 64 20 5c 2a 64 |*memcpy(|void \*d|
|00003fb0| 73 74 2c 20 63 6f 6e 73 | 74 7e 76 6f 69 64 20 5c |st, cons|t~void \|
|00003fc0| 2a 73 72 63 2c 20 73 69 | 7a 65 5c 5f 74 20 6e 6f |*src, si|ze\_t no|
|00003fd0| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 43 6f 70 79 20 7b |);}.\exp|l{Copy {|
|00003fe0| 5c 73 6c 20 6e 6f 7d 20 | 6f 66 20 62 79 74 65 73 |\sl no} |of bytes|
|00003ff0| 20 66 72 6f 6d 20 61 72 | 65 61 20 61 74 20 7b 5c | from ar|ea at {\|
|00004000| 73 6c 20 73 72 63 7d 20 | 74 6f 20 7b 5c 73 6c 20 |sl src} |to {\sl |
|00004010| 64 73 74 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |dst}.}..|\functio|
|00004020| 6e 7b 76 6f 69 64 20 5c | 2a 6d 65 6d 73 65 74 28 |n{void \|*memset(|
|00004030| 76 6f 69 64 20 5c 2a 70 | 74 72 2c 20 69 6e 74 20 |void \*p|tr, int |
|00004040| 75 63 68 61 72 66 69 6c | 6c 2c 20 73 69 7a 65 5c |ucharfil|l, size\|
|00004050| 5f 74 20 6e 6f 29 3b 7d | 0a 5c 65 78 70 6c 7b 53 |_t no);}|.\expl{S|
|00004060| 65 74 20 7b 5c 73 6c 20 | 6e 6f 7d 20 6f 66 20 62 |et {\sl |no} of b|
|00004070| 79 74 65 73 20 61 74 20 | 70 6f 73 69 74 69 6f 6e |ytes at |position|
|00004080| 20 7b 5c 73 6c 20 70 74 | 72 7d 20 74 6f 20 63 68 | {\sl pt|r} to ch|
|00004090| 61 72 61 63 74 65 72 20 | 7b 5c 73 6c 0a 75 63 68 |aracter |{\sl.uch|
|000040a0| 61 72 66 69 6c 6c 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |arfill}.|}..\func|
|000040b0| 74 69 6f 6e 7b 63 68 61 | 72 20 5c 2a 73 74 72 63 |tion{cha|r \*strc|
|000040c0| 61 74 28 63 68 61 72 20 | 5c 2a 64 73 74 2c 20 63 |at(char |\*dst, c|
|000040d0| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 73 72 63 29 |onst~cha|r \*src)|
|000040e0| 3b 7d 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 63 68 61 |;}.\func|tion{cha|
|000040f0| 72 20 5c 2a 73 74 72 6e | 63 61 74 28 63 68 61 72 |r \*strn|cat(char|
|00004100| 20 5c 2a 64 73 74 2c 20 | 63 6f 6e 73 74 7e 63 68 | \*dst, |const~ch|
|00004110| 61 72 20 5c 2a 73 72 63 | 2c 20 73 69 7a 65 5c 5f |ar \*src|, size\_|
|00004120| 74 20 6e 6f 29 3b 7d 0a | 5c 65 78 70 6c 7b 43 6f |t no);}.|\expl{Co|
|00004130| 6e 63 61 74 65 6e 61 74 | 65 20 74 68 65 20 73 74 |ncatenat|e the st|
|00004140| 72 69 6e 67 20 61 74 20 | 7b 5c 73 6c 20 73 72 63 |ring at |{\sl src|
|00004150| 7d 20 74 6f 20 74 68 65 | 20 73 74 72 69 6e 67 20 |} to the| string |
|00004160| 61 74 20 7b 5c 73 6c 20 | 64 73 74 7d 2e 0a 7b 5c |at {\sl |dst}..{\|
|00004170| 62 66 20 73 74 72 6e 63 | 61 74 7d 28 29 20 63 6f |bf strnc|at}() co|
|00004180| 6e 63 61 74 65 6e 61 74 | 65 73 20 61 74 20 6d 6f |ncatenat|es at mo|
|00004190| 73 74 20 7b 5c 73 6c 20 | 6e 6f 5c 2f 7d 20 63 68 |st {\sl |no\/} ch|
|000041a0| 61 72 61 63 74 65 72 73 | 2e 7d 0a 0a 5c 66 75 6e |aracters|.}..\fun|
|000041b0| 63 74 69 6f 6e 7b 63 68 | 61 72 20 5c 2a 73 74 72 |ction{ch|ar \*str|
|000041c0| 63 68 72 28 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |chr(cons|t~char \|
|000041d0| 2a 73 74 72 2c 20 69 6e | 74 20 63 68 61 72 77 29 |*str, in|t charw)|
|000041e0| 3b 7d 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 63 68 61 |;}.\func|tion{cha|
|000041f0| 72 20 5c 2a 73 74 72 72 | 63 68 72 28 63 6f 6e 73 |r \*strr|chr(cons|
|00004200| 74 7e 63 68 61 72 20 5c | 2a 73 74 72 2c 20 69 6e |t~char \|*str, in|
|00004210| 74 20 63 68 61 72 77 29 | 3b 7d 0a 5c 65 78 70 6c |t charw)|;}.\expl|
|00004220| 7b 46 69 6e 64 20 66 69 | 72 73 74 20 28 6c 61 73 |{Find fi|rst (las|
|00004230| 74 29 20 6f 63 63 75 72 | 65 6e 63 65 20 6f 66 20 |t) occur|ence of |
|00004240| 63 68 61 72 61 63 74 65 | 72 20 7b 5c 73 6c 20 63 |characte|r {\sl c|
|00004250| 68 61 72 77 7d 20 69 6e | 20 73 74 72 69 6e 67 0a |harw} in| string.|
|00004260| 7b 5c 73 6c 20 73 74 72 | 7d 2e 7d 20 0a 0a 5c 66 |{\sl str|}.} ..\f|
|00004270| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 73 74 72 63 |unction{|int strc|
|00004280| 6d 70 28 63 6f 6e 73 74 | 7e 63 68 61 72 20 5c 2a |mp(const|~char \*|
|00004290| 73 74 72 31 2c 20 63 6f | 6e 73 74 7e 63 68 61 72 |str1, co|nst~char|
|000042a0| 20 5c 2a 73 74 72 32 29 | 3b 7d 0a 5c 66 75 6e 63 | \*str2)|;}.\func|
|000042b0| 74 69 6f 6e 7b 69 6e 74 | 20 73 74 72 6e 63 6d 70 |tion{int| strncmp|
|000042c0| 28 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 73 74 |(const~c|har \*st|
|000042d0| 72 31 2c 20 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |r1, cons|t~char \|
|000042e0| 2a 73 74 72 32 2c 20 73 | 69 7a 65 5c 5f 74 20 6e |*str2, s|ize\_t n|
|000042f0| 6f 29 3b 7d 0a 5c 65 78 | 70 6c 7b 43 6f 6d 70 61 |o);}.\ex|pl{Compa|
|00004300| 72 65 20 73 74 72 69 6e | 67 20 7b 5c 73 6c 20 73 |re strin|g {\sl s|
|00004310| 74 72 31 5c 2f 7d 20 77 | 69 74 68 20 73 74 72 69 |tr1\/} w|ith stri|
|00004320| 6e 67 20 7b 5c 73 6c 20 | 73 74 72 31 5c 2f 7d 2e |ng {\sl |str1\/}.|
|00004330| 20 7b 5c 62 66 0a 73 74 | 72 6e 63 6d 70 7d 28 29 | {\bf.st|rncmp}()|
|00004340| 20 63 6f 6d 70 61 72 65 | 73 20 61 74 20 6d 6f 73 | compare|s at mos|
|00004350| 74 20 7b 5c 73 6c 20 6e | 6f 5c 2f 7d 20 63 68 61 |t {\sl n|o\/} cha|
|00004360| 72 61 63 74 65 72 73 2e | 7d 0a 0a 5c 66 75 6e 63 |racters.|}..\func|
|00004370| 74 69 6f 6e 7b 63 68 61 | 72 20 5c 2a 73 74 72 63 |tion{cha|r \*strc|
|00004380| 70 79 28 63 68 61 72 20 | 5c 2a 64 73 74 2c 20 63 |py(char |\*dst, c|
|00004390| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 73 72 63 29 |onst~cha|r \*src)|
|000043a0| 3b 7d 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 63 68 61 |;}.\func|tion{cha|
|000043b0| 72 20 5c 2a 73 74 72 6e | 63 70 79 28 63 68 61 72 |r \*strn|cpy(char|
|000043c0| 20 5c 2a 64 73 74 2c 20 | 63 6f 6e 73 74 7e 63 68 | \*dst, |const~ch|
|000043d0| 61 72 20 5c 2a 73 72 63 | 2c 20 73 69 7a 65 5c 5f |ar \*src|, size\_|
|000043e0| 74 20 6e 6f 29 3b 7d 0a | 5c 65 78 70 6c 7b 43 6f |t no);}.|\expl{Co|
|000043f0| 70 79 20 73 74 72 69 6e | 67 20 61 74 20 7b 5c 73 |py strin|g at {\s|
|00004400| 6c 20 73 72 63 5c 2f 7d | 20 74 6f 20 7b 5c 73 6c |l src\/}| to {\sl|
|00004410| 20 64 73 74 5c 2f 7d 2e | 20 7b 5c 62 66 20 73 74 | dst\/}.| {\bf st|
|00004420| 72 6e 63 70 79 7d 28 29 | 0a 63 6f 70 69 65 73 20 |rncpy}()|.copies |
|00004430| 61 74 20 6d 6f 73 74 20 | 7b 73 6c 20 6e 6f 7d 20 |at most |{sl no} |
|00004440| 63 68 61 72 61 63 74 65 | 72 73 2e 7d 20 0a 0a 5c |characte|rs.} ..\|
|00004450| 66 75 6e 63 74 69 6f 6e | 7b 73 69 7a 65 5c 5f 74 |function|{size\_t|
|00004460| 20 73 74 72 63 73 70 6e | 28 63 6f 6e 73 74 7e 63 | strcspn|(const~c|
|00004470| 68 61 72 20 5c 2a 73 74 | 72 2c 20 63 6f 6e 73 74 |har \*st|r, const|
|00004480| 7e 63 68 61 72 20 5c 2a | 72 65 6a 29 3b 7d 0a 5c |~char \*|rej);}.\|
|00004490| 65 78 70 6c 7b 46 69 6e | 64 20 6c 65 6e 67 74 68 |expl{Fin|d length|
|000044a0| 20 6f 66 20 69 6e 69 74 | 69 61 6c 20 73 65 67 6d | of init|ial segm|
|000044b0| 65 6e 74 20 6f 66 20 7b | 5c 73 6c 20 73 74 72 7d |ent of {|\sl str}|
|000044c0| 20 63 6f 6e 73 69 73 74 | 69 6e 67 20 65 6e 74 69 | consist|ing enti|
|000044d0| 72 65 6c 79 0a 6f 66 20 | 63 68 61 72 61 63 74 65 |rely.of |characte|
|000044e0| 72 73 20 6e 6f 74 20 66 | 72 6f 6d 20 7b 5c 73 6c |rs not f|rom {\sl|
|000044f0| 20 72 65 6a 7d 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 | rej}.}.|.\functi|
|00004500| 6f 6e 7b 63 68 61 72 20 | 5c 2a 73 74 72 64 75 70 |on{char |\*strdup|
|00004510| 28 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 73 74 |(const~c|har \*st|
|00004520| 72 29 3b 7d 0a 5c 65 78 | 70 6c 7b 52 65 74 75 72 |r);}.\ex|pl{Retur|
|00004530| 6e 20 61 20 64 75 70 6c | 69 63 61 74 65 20 6f 66 |n a dupl|icate of|
|00004540| 20 73 74 72 69 6e 67 20 | 7b 5c 73 6c 20 73 74 72 | string |{\sl str|
|00004550| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 63 |}.}..\fu|nction{c|
|00004560| 68 61 72 20 5c 2a 73 74 | 72 65 72 72 6f 72 28 69 |har \*st|rerror(i|
|00004570| 6e 74 20 65 72 72 6e 6f | 29 3b 7d 0a 5c 65 78 70 |nt errno|);}.\exp|
|00004580| 6c 7b 4d 61 70 20 65 72 | 72 6f 72 20 6e 75 6d 62 |l{Map er|ror numb|
|00004590| 65 72 20 7b 5c 73 6c 20 | 65 72 72 6e 6f 7d 20 74 |er {\sl |errno} t|
|000045a0| 6f 20 61 20 64 65 73 63 | 72 69 70 74 69 76 65 20 |o a desc|riptive |
|000045b0| 73 74 72 69 6e 67 2e 7d | 0a 0a 5c 66 75 6e 63 74 |string.}|..\funct|
|000045c0| 69 6f 6e 7b 69 6e 74 20 | 73 74 72 69 63 6d 70 28 |ion{int |stricmp(|
|000045d0| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 73 74 72 |const~ch|ar \*str|
|000045e0| 31 2c 20 63 6f 6e 73 74 | 7e 63 68 61 72 20 5c 2a |1, const|~char \*|
|000045f0| 73 74 72 32 29 3b 7d 0a | 5c 66 75 6e 63 74 69 6f |str2);}.|\functio|
|00004600| 6e 7b 69 6e 74 20 73 74 | 72 63 6d 70 69 28 63 6f |n{int st|rcmpi(co|
|00004610| 6e 73 74 7e 63 68 61 72 | 20 5c 2a 73 74 72 31 2c |nst~char| \*str1,|
|00004620| 20 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 73 74 | const~c|har \*st|
|00004630| 72 32 29 3b 7d 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |r2);}.\f|unction{|
|00004640| 69 6e 74 20 73 74 72 6e | 69 63 6d 70 28 63 6f 6e |int strn|icmp(con|
|00004650| 73 74 7e 63 68 61 72 20 | 5c 2a 73 74 72 31 2c 20 |st~char |\*str1, |
|00004660| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 73 74 72 |const~ch|ar \*str|
|00004670| 32 2c 20 73 69 7a 65 5c | 5f 74 20 6e 6f 29 3b 7d |2, size\|_t no);}|
|00004680| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 69 6e 74 20 73 |.\functi|on{int s|
|00004690| 74 72 6e 63 6d 70 69 28 | 63 6f 6e 73 74 7e 63 68 |trncmpi(|const~ch|
|000046a0| 61 72 20 5c 2a 73 74 72 | 31 2c 20 63 6f 6e 73 74 |ar \*str|1, const|
|000046b0| 7e 63 68 61 72 20 5c 2a | 73 74 72 32 2c 20 73 69 |~char \*|str2, si|
|000046c0| 7a 65 5c 5f 74 20 6e 6f | 29 3b 7d 0a 5c 65 78 70 |ze\_t no|);}.\exp|
|000046d0| 6c 7b 53 61 6d 65 20 61 | 73 20 7b 5c 62 66 20 73 |l{Same a|s {\bf s|
|000046e0| 74 72 63 6d 70 7d 28 29 | 20 61 6e 64 20 7b 5c 62 |trcmp}()| and {\b|
|000046f0| 66 20 73 74 72 6e 63 6d | 70 7d 28 29 2c 20 65 78 |f strncm|p}(), ex|
|00004700| 63 65 70 74 20 74 68 65 | 20 63 61 73 65 20 69 73 |cept the| case is|
|00004710| 0a 69 67 6e 6f 72 65 64 | 2e 7d 0a 0a 5c 66 75 6e |.ignored|.}..\fun|
|00004720| 63 74 69 6f 6e 7b 73 69 | 7a 65 5c 5f 74 20 73 74 |ction{si|ze\_t st|
|00004730| 72 6c 65 6e 28 63 6f 6e | 73 74 7e 63 68 61 72 20 |rlen(con|st~char |
|00004740| 5c 2a 73 74 72 29 3b 7d | 0a 5c 65 78 70 6c 7b 52 |\*str);}|.\expl{R|
|00004750| 65 74 75 72 6e 20 6c 65 | 6e 67 74 68 20 6f 66 20 |eturn le|ngth of |
|00004760| 73 74 72 69 6e 67 20 7b | 5c 73 6c 20 73 74 72 7d |string {|\sl str}|
|00004770| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 63 68 |.}..\fun|ction{ch|
|00004780| 61 72 20 5c 2a 73 74 72 | 6c 77 72 28 63 68 61 72 |ar \*str|lwr(char|
|00004790| 20 5c 2a 73 74 72 29 3b | 7d 0a 5c 65 78 70 6c 7b | \*str);|}.\expl{|
|000047a0| 43 68 61 6e 67 65 20 61 | 6c 6c 20 63 68 61 72 61 |Change a|ll chara|
|000047b0| 63 74 65 72 20 66 72 6f | 6d 20 73 74 72 69 6e 67 |cter fro|m string|
|000047c0| 20 7b 5c 73 6c 20 73 74 | 72 7d 20 74 6f 20 6c 6f | {\sl st|r} to lo|
|000047d0| 77 65 72 63 61 73 65 2e | 7d 0a 0a 5c 66 75 6e 63 |wercase.|}..\func|
|000047e0| 74 69 6f 6e 7b 63 68 61 | 72 20 5c 2a 73 74 72 70 |tion{cha|r \*strp|
|000047f0| 62 72 6b 28 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |brk(cons|t~char \|
|00004800| 2a 73 74 72 2c 20 63 6f | 6e 73 74 7e 63 68 61 72 |*str, co|nst~char|
|00004810| 20 5c 2a 62 72 65 61 6b | 61 74 29 3b 7d 0a 5c 65 | \*break|at);}.\e|
|00004820| 78 70 6c 7b 46 69 72 73 | 74 20 6f 63 63 75 72 72 |xpl{Firs|t occurr|
|00004830| 65 6e 63 65 20 6f 66 20 | 61 20 63 68 61 72 61 63 |ence of |a charac|
|00004840| 74 65 72 20 66 72 6f 6d | 20 73 74 72 69 6e 67 20 |ter from| string |
|00004850| 7b 5c 73 6c 20 62 72 65 | 61 6b 61 74 7d 20 69 6e |{\sl bre|akat} in|
|00004860| 20 73 74 72 69 6e 67 0a | 7b 5c 73 6c 20 73 74 72 | string.|{\sl str|
|00004870| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 63 |}.}..\fu|nction{c|
|00004880| 68 61 72 20 5c 2a 73 74 | 72 72 65 76 28 63 68 61 |har \*st|rrev(cha|
|00004890| 72 20 5c 2a 73 74 72 29 | 3b 7d 0a 5c 65 78 70 6c |r \*str)|;}.\expl|
|000048a0| 7b 52 65 76 65 72 73 65 | 20 61 6c 6c 20 63 68 61 |{Reverse| all cha|
|000048b0| 72 63 74 65 72 73 20 69 | 6e 20 73 74 72 69 6e 67 |rcters i|n string|
|000048c0| 20 7b 5c 73 6c 20 73 74 | 72 7d 2e 20 46 69 72 73 | {\sl st|r}. Firs|
|000048d0| 74 20 63 68 61 72 61 63 | 74 65 72 0a 62 65 63 6f |t charac|ter.beco|
|000048e0| 6d 65 73 20 6c 61 73 74 | 20 63 68 61 72 61 63 74 |mes last| charact|
|000048f0| 65 72 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |er.}..\f|unction{|
|00004900| 73 69 7a 65 5c 5f 74 20 | 73 74 72 73 70 6e 28 63 |size\_t |strspn(c|
|00004910| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 73 74 72 2c |onst~cha|r \*str,|
|00004920| 20 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 61 63 | const~c|har \*ac|
|00004930| 63 65 70 74 29 3b 7d 0a | 5c 65 78 70 6c 7b 46 69 |cept);}.|\expl{Fi|
|00004940| 6e 64 20 6c 65 6e 67 74 | 68 20 6f 66 20 69 6e 69 |nd lengt|h of ini|
|00004950| 74 69 61 6c 20 73 65 67 | 6d 65 6e 74 20 6f 66 20 |tial seg|ment of |
|00004960| 7b 5c 73 6c 20 73 74 72 | 7d 20 63 6f 6e 73 69 73 |{\sl str|} consis|
|00004970| 74 69 6e 67 20 65 6e 74 | 69 72 65 6c 79 0a 6f 66 |ting ent|irely.of|
|00004980| 20 63 68 61 72 61 63 74 | 65 72 73 20 66 72 6f 6d | charact|ers from|
|00004990| 20 7b 5c 73 6c 20 61 63 | 63 65 70 74 7d 2e 7d 0a | {\sl ac|cept}.}.|
|000049a0| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 63 68 61 72 20 |.\functi|on{char |
|000049b0| 5c 2a 73 74 72 73 74 72 | 28 63 6f 6e 73 74 7e 63 |\*strstr|(const~c|
|000049c0| 68 61 72 20 5c 2a 73 74 | 72 2c 20 63 6f 6e 73 74 |har \*st|r, const|
|000049d0| 7e 63 68 61 72 20 5c 2a | 77 61 6e 74 65 64 29 3b |~char \*|wanted);|
|000049e0| 7d 0a 5c 65 78 70 6c 7b | 46 69 6e 64 20 66 69 72 |}.\expl{|Find fir|
|000049f0| 73 74 20 6f 63 63 75 72 | 65 6e 63 65 20 6f 66 20 |st occur|ence of |
|00004a00| 73 74 72 69 6e 67 20 7b | 5c 73 6c 20 77 61 6e 74 |string {|\sl want|
|00004a10| 65 64 7d 20 69 6e 20 73 | 74 72 69 6e 67 20 7b 5c |ed} in s|tring {\|
|00004a20| 73 6c 0a 73 74 72 7d 2e | 7d 20 0a 0a 5c 66 75 6e |sl.str}.|} ..\fun|
|00004a30| 63 74 69 6f 6e 7b 63 68 | 61 72 20 5c 2a 73 74 72 |ction{ch|ar \*str|
|00004a40| 74 6f 6b 28 63 68 61 72 | 20 5c 2a 73 74 72 2c 20 |tok(char| \*str, |
|00004a50| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 64 65 6c |const~ch|ar \*del|
|00004a60| 69 6d 29 3b 7d 0a 5c 65 | 78 70 6c 7b 52 65 74 72 |im);}.\e|xpl{Retr|
|00004a70| 69 65 76 65 20 66 69 65 | 6c 64 73 20 66 72 6f 6d |ieve fie|lds from|
|00004a80| 20 73 74 72 69 6e 67 20 | 7b 5c 73 6c 20 73 74 72 | string |{\sl str|
|00004a90| 7d 2c 20 74 68 61 74 20 | 61 72 65 20 64 65 6c 69 |}, that |are deli|
|00004aa0| 6d 69 74 65 64 20 62 79 | 0a 63 68 61 72 61 63 74 |mited by|.charact|
|00004ab0| 65 72 73 20 66 72 6f 6d | 20 73 74 72 69 6e 67 20 |ers from| string |
|00004ac0| 7b 5c 73 6c 20 64 65 6c | 69 6d 7d 2e 7d 0a 0a 25 |{\sl del|im}.}..%|
|00004ad0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004ae0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004af0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004b00| 25 25 25 25 25 25 25 25 | 25 25 25 0a 0c 0a 5c 73 |%%%%%%%%|%%%...\s|
|00004b10| 65 63 74 69 6f 6e 7b 50 | 72 6f 63 65 73 73 20 4d |ection{P|rocess M|
|00004b20| 61 6e 61 67 65 6d 65 6e | 74 7d 0a 0a 5c 23 69 6e |anagemen|t}..\#in|
|00004b30| 63 6c 75 64 65 20 5c 3c | 73 74 64 6c 69 62 2e 68 |clude \<|stdlib.h|
|00004b40| 3e 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 76 6f 69 |>..\func|tion{voi|
|00004b50| 64 20 61 62 6f 72 74 28 | 29 3b 7d 0a 5c 65 78 70 |d abort(|);}.\exp|
|00004b60| 6c 7b 49 6d 6d 65 64 69 | 61 74 6c 79 20 61 62 6f |l{Immedi|atly abo|
|00004b70| 72 74 20 74 68 65 20 72 | 75 6e 6e 69 6e 67 20 70 |rt the r|unning p|
|00004b80| 72 6f 67 72 61 6d 2e 7d | 0a 0a 5c 66 75 6e 63 74 |rogram.}|..\funct|
|00004b90| 69 6f 6e 7b 69 6e 74 20 | 61 74 65 78 69 74 28 76 |ion{int |atexit(v|
|00004ba0| 6f 69 64 20 28 5c 2a 66 | 75 6e 63 29 28 29 29 3b |oid (\*f|unc)());|
|00004bb0| 7d 0a 5c 65 78 70 6c 7b | 52 65 67 69 73 74 65 72 |}.\expl{|Register|
|00004bc0| 20 61 20 66 75 6e 63 74 | 69 6f 6e 20 66 6f 72 20 | a funct|ion for |
|00004bd0| 65 78 65 63 75 74 69 6f | 6e 20 6f 6e 20 74 65 72 |executio|n on ter|
|00004be0| 6d 69 6e 61 74 69 6f 6e | 2e 7d 0a 0a 5c 66 75 6e |mination|.}..\fun|
|00004bf0| 63 74 69 6f 6e 7b 76 6f | 69 64 20 65 78 69 74 28 |ction{vo|id exit(|
|00004c00| 69 6e 74 20 72 65 74 29 | 3b 7d 0a 5c 65 78 70 6c |int ret)|;}.\expl|
|00004c10| 7b 45 78 69 74 20 63 75 | 72 72 65 6e 74 20 70 72 |{Exit cu|rrent pr|
|00004c20| 6f 63 65 73 73 20 77 69 | 74 68 20 72 65 74 75 72 |ocess wi|th retur|
|00004c30| 6e 20 76 61 6c 75 65 20 | 7b 5c 73 6c 20 72 65 74 |n value |{\sl ret|
|00004c40| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 69 |}.}..\fu|nction{i|
|00004c50| 6e 74 20 73 79 73 74 65 | 6d 28 63 6f 6e 73 74 7e |nt syste|m(const~|
|00004c60| 63 68 61 72 20 5c 2a 70 | 72 6f 67 29 3b 7d 0a 5c |char \*p|rog);}.\|
|00004c70| 65 78 70 6c 7b 45 78 65 | 63 75 74 65 20 63 6f 6d |expl{Exe|cute com|
|00004c80| 6d 61 6e 64 20 7b 5c 73 | 6c 20 70 72 6f 67 7d 20 |mand {\s|l prog} |
|00004c90| 70 61 73 73 65 64 20 61 | 73 20 61 20 73 74 72 69 |passed a|s a stri|
|00004ca0| 6e 67 2e 7d 0a 5c 6d 65 | 64 73 6b 69 70 0a 5c 23 |ng.}.\me|dskip.\#|
|00004cb0| 69 6e 63 6c 75 64 65 20 | 5c 3c 70 72 6f 63 65 73 |include |\<proces|
|00004cc0| 73 2e 68 3e 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |s.h>..\f|unction{|
|00004cd0| 69 6e 74 20 73 70 61 77 | 6e 6c 28 69 6e 74 20 6d |int spaw|nl(int m|
|00004ce0| 6f 64 65 2c 20 63 68 61 | 72 20 5c 2a 70 61 74 68 |ode, cha|r \*path|
|00004cf0| 2c 20 24 5c 6c 64 6f 74 | 73 24 29 3b 7d 0a 5c 66 |, $\ldot|s$);}.\f|
|00004d00| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 73 70 61 77 |unction{|int spaw|
|00004d10| 6e 76 28 69 6e 74 20 6d | 6f 64 65 2c 20 63 68 61 |nv(int m|ode, cha|
|00004d20| 72 20 5c 2a 70 61 74 68 | 2c 20 63 68 61 72 20 7b |r \*path|, char {|
|00004d30| 5c 2a 5c 2a 7d 61 72 67 | 76 29 3b 7d 0a 5c 66 75 |\*\*}arg|v);}.\fu|
|00004d40| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 73 70 61 77 6e |nction{i|nt spawn|
|00004d50| 6c 65 28 69 6e 74 20 6d | 6f 64 65 2c 20 63 68 61 |le(int m|ode, cha|
|00004d60| 72 20 5c 2a 70 61 74 68 | 2c 20 24 5c 6c 64 6f 74 |r \*path|, $\ldot|
|00004d70| 73 24 29 3b 7d 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |s$);}.\f|unction{|
|00004d80| 69 6e 74 20 73 70 61 77 | 6e 76 65 28 69 6e 74 20 |int spaw|nve(int |
|00004d90| 6d 6f 64 65 2c 20 63 68 | 61 72 20 5c 2a 70 61 74 |mode, ch|ar \*pat|
|00004da0| 68 2c 20 63 68 61 72 20 | 7b 5c 2a 5c 2a 7d 61 72 |h, char |{\*\*}ar|
|00004db0| 67 76 2c 20 63 68 61 72 | 20 7b 5c 2a 5c 2a 7d 65 |gv, char| {\*\*}e|
|00004dc0| 6e 76 70 29 3b 7d 0a 5c | 65 78 70 6c 7b 53 70 61 |nvp);}.\|expl{Spa|
|00004dd0| 77 6e 20 61 20 6e 65 77 | 20 70 72 6f 63 65 73 73 |wn a new| process|
|00004de0| 2e 20 28 4f 6e 6c 79 20 | 7b 5c 74 74 20 50 5c 5f |. (Only |{\tt P\_|
|00004df0| 57 41 49 54 7d 20 69 73 | 20 61 6c 6c 6f 77 65 64 |WAIT} is| allowed|
|00004e00| 20 66 6f 72 20 7b 5c 73 | 6c 0a 6d 6f 64 65 7d 29 | for {\s|l.mode})|
|00004e10| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |.}..\fun|ction{in|
|00004e20| 74 20 73 70 61 77 6e 76 | 70 28 69 6e 74 20 6d 6f |t spawnv|p(int mo|
|00004e30| 64 65 2c 20 63 68 61 72 | 20 5c 2a 6e 61 6d 65 2c |de, char| \*name,|
|00004e40| 20 63 68 61 72 20 7b 5c | 2a 5c 2a 7d 61 72 67 76 | char {\|*\*}argv|
|00004e50| 29 3b 7d 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |);}.\fun|ction{in|
|00004e60| 74 20 73 70 61 77 6e 6c | 70 28 69 6e 74 20 6d 6f |t spawnl|p(int mo|
|00004e70| 64 65 2c 20 63 68 61 72 | 20 5c 2a 6e 61 6d 65 2c |de, char| \*name,|
|00004e80| 20 24 5c 6c 64 6f 74 73 | 24 29 3b 7d 0a 5c 65 78 | $\ldots|$);}.\ex|
|00004e90| 70 6c 7b 45 78 65 63 75 | 74 65 20 61 20 70 72 6f |pl{Execu|te a pro|
|00004ea0| 67 72 61 6d 20 6f 6e 20 | 74 68 65 20 64 65 66 61 |gram on |the defa|
|00004eb0| 75 74 6c 20 73 79 73 74 | 65 6d 20 65 78 65 63 75 |utl syst|em execu|
|00004ec0| 74 69 6f 6e 20 70 61 74 | 68 2e 20 28 54 68 65 0a |tion pat|h. (The.|
|00004ed0| 63 75 72 72 65 6e 74 20 | 64 69 72 65 63 74 6f 72 |current |director|
|00004ee0| 79 20 69 73 20 61 6c 77 | 61 79 73 20 73 65 61 72 |y is alw|ays sear|
|00004ef0| 63 68 65 64 20 66 69 72 | 73 74 2e 29 7d 0a 0a 25 |ched fir|st.)}..%|
|00004f00| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004f10| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004f20| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004f30| 25 25 25 25 25 25 25 25 | 25 25 25 0a 0c 0a 5c 73 |%%%%%%%%|%%%...\s|
|00004f40| 65 63 74 69 6f 6e 7b 44 | 61 74 65 20 61 6e 64 20 |ection{D|ate and |
|00004f50| 54 69 6d 65 7d 0a 0a 5c | 23 69 6e 63 6c 75 64 65 |Time}..\|#include|
|00004f60| 20 5c 3c 74 69 6d 65 2e | 68 3e 0a 0a 5c 66 75 6e | \<time.|h>..\fun|
|00004f70| 63 74 69 6f 6e 7b 63 68 | 61 72 20 5c 2a 61 73 63 |ction{ch|ar \*asc|
|00004f80| 74 69 6d 65 28 63 6f 6e | 73 74 7e 73 74 72 75 63 |time(con|st~struc|
|00004f90| 74 20 74 6d 20 5c 2a 74 | 29 3b 7d 0a 5c 65 78 70 |t tm \*t|);}.\exp|
|00004fa0| 6c 7b 43 6f 6e 76 65 72 | 74 20 60 60 74 69 6d 65 |l{Conver|t ``time|
|00004fb0| 27 27 20 73 74 72 75 63 | 74 75 72 65 20 74 6f 20 |'' struc|ture to |
|00004fc0| 61 20 73 74 72 69 6e 67 | 2e 7d 0a 0a 5c 66 75 6e |a string|.}..\fun|
|00004fd0| 63 74 69 6f 6e 7b 63 6c | 6f 63 6b 5c 5f 74 20 63 |ction{cl|ock\_t c|
|00004fe0| 6c 6f 63 6b 28 29 3b 7d | 0a 5c 65 78 70 6c 7b 52 |lock();}|.\expl{R|
|00004ff0| 65 74 75 72 6e 20 70 72 | 6f 63 65 73 73 20 74 69 |eturn pr|ocess ti|
|00005000| 6d 65 20 75 73 65 64 20 | 73 6f 20 66 61 72 20 69 |me used |so far i|
|00005010| 6e 20 75 6e 69 74 73 20 | 6f 66 20 43 4c 4b 5c 5f |n units |of CLK\_|
|00005020| 54 43 4b 20 74 69 63 6b | 73 20 70 65 72 0a 73 65 |TCK tick|s per.se|
|00005030| 63 6f 6e 64 20 28 75 6e | 64 65 72 20 54 4f 53 2c |cond (un|der TOS,|
|00005040| 20 32 30 30 20 70 65 72 | 20 73 65 63 6f 6e 64 29 | 200 per| second)|
|00005050| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 63 68 |.}..\fun|ction{ch|
|00005060| 61 72 20 5c 2a 63 74 69 | 6d 65 28 63 6f 6e 73 74 |ar \*cti|me(const|
|00005070| 7e 74 69 6d 65 5c 5f 74 | 20 5c 2a 74 29 3b 7d 0a |~time\_t| \*t);}.|
|00005080| 5c 65 78 70 6c 7b 43 6f | 6e 76 65 72 74 20 74 69 |\expl{Co|nvert ti|
|00005090| 6d 65 20 69 6e 20 73 65 | 63 6f 6e 64 73 20 73 69 |me in se|conds si|
|000050a0| 6e 63 65 20 31 39 37 30 | 20 74 6f 20 61 20 73 74 |nce 1970| to a st|
|000050b0| 72 69 6e 67 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |ring.}..|\functio|
|000050c0| 6e 7b 64 6f 75 62 6c 65 | 20 64 69 66 66 74 69 6d |n{double| difftim|
|000050d0| 65 28 74 69 6d 65 5c 5f | 74 20 74 31 2c 20 74 69 |e(time\_|t t1, ti|
|000050e0| 6d 65 5c 5f 74 20 74 32 | 29 3b 7d 0a 5c 65 78 70 |me\_t t2|);}.\exp|
|000050f0| 6c 7b 52 65 74 75 72 6e | 20 64 69 66 66 65 72 65 |l{Return| differe|
|00005100| 6e 63 65 20 62 65 74 77 | 65 65 6e 20 74 77 6f 20 |nce betw|een two |
|00005110| 60 60 74 69 6d 65 5c 5f | 74 27 27 20 74 79 70 65 |``time\_|t'' type|
|00005120| 73 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 73 |s.}..\fu|nction{s|
|00005130| 74 72 75 63 74 7e 74 6d | 20 5c 2a 67 6d 74 69 6d |truct~tm| \*gmtim|
|00005140| 65 28 63 6f 6e 73 74 7e | 74 69 6d 65 5c 5f 74 20 |e(const~|time\_t |
|00005150| 5c 2a 74 29 3b 7d 0a 5c | 65 78 70 6c 7b 47 65 74 |\*t);}.\|expl{Get|
|00005160| 20 74 68 65 20 47 72 65 | 65 6e 77 69 63 68 20 4d | the Gre|enwich M|
|00005170| 65 61 6e 20 74 69 6d 65 | 2e 7d 0a 0a 5c 66 75 6e |ean time|.}..\fun|
|00005180| 63 74 69 6f 6e 7b 73 74 | 72 75 63 74 7e 74 6d 20 |ction{st|ruct~tm |
|00005190| 5c 2a 6c 6f 63 61 6c 74 | 69 6d 65 28 63 6f 6e 73 |\*localt|ime(cons|
|000051a0| 74 7e 74 69 6d 65 5c 5f | 74 20 5c 2a 74 29 3b 7d |t~time\_|t \*t);}|
|000051b0| 0a 5c 65 78 70 6c 7b 43 | 6f 6e 76 65 72 74 20 67 |.\expl{C|onvert g|
|000051c0| 69 76 65 6e 20 74 69 6d | 65 20 69 6e 20 73 65 63 |iven tim|e in sec|
|000051d0| 6f 6e 64 73 20 73 69 6e | 63 65 20 31 39 37 30 20 |onds sin|ce 1970 |
|000051e0| 74 6f 20 6c 6f 63 61 6c | 20 74 69 6d 65 2e 7d 0a |to local| time.}.|
|000051f0| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 74 69 6d 65 5c |.\functi|on{time\|
|00005200| 5f 74 20 6d 6b 74 69 6d | 65 28 63 6f 6e 73 74 7e |_t mktim|e(const~|
|00005210| 73 74 72 75 63 74 20 74 | 6d 20 5c 2a 74 29 3b 7d |struct t|m \*t);}|
|00005220| 0a 5c 65 78 70 6c 7b 54 | 61 6b 65 20 61 20 74 69 |.\expl{T|ake a ti|
|00005230| 6d 65 20 73 74 72 75 63 | 74 75 72 65 20 61 6e 64 |me struc|ture and|
|00005240| 20 63 6f 6e 76 65 72 74 | 20 69 74 20 69 6e 74 6f | convert| it into|
|00005250| 20 72 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 20 | represe|ntation |
|00005260| 60 60 73 65 63 6f 6e 64 | 73 0a 73 69 6e 63 65 20 |``second|s.since |
|00005270| 6d 69 64 6e 69 67 68 74 | 20 4a 61 6e 75 61 72 79 |midnight| January|
|00005280| 20 31 20 31 39 37 30 2c | 20 47 4d 54 27 27 2e 7d | 1 1970,| GMT''.}|
|00005290| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 73 69 7a 65 |..\funct|ion{size|
|000052a0| 5c 5f 74 20 73 74 72 66 | 74 69 6d 65 28 63 68 61 |\_t strf|time(cha|
|000052b0| 72 20 5c 2a 73 2c 20 73 | 69 7a 65 5c 5f 74 20 6d |r \*s, s|ize\_t m|
|000052c0| 61 78 73 69 7a 65 2c 20 | 63 6f 6e 73 74 7e 63 68 |axsize, |const~ch|
|000052d0| 61 72 20 5c 2a 66 6f 72 | 6d 61 74 2c 0a 63 6f 6e |ar \*for|mat,.con|
|000052e0| 73 74 7e 73 74 72 75 63 | 74 20 74 6d 20 5c 2a 74 |st~struc|t tm \*t|
|000052f0| 69 6d 65 70 74 72 29 3b | 7d 0a 5c 65 78 70 6c 7b |imeptr);|}.\expl{|
|00005300| 50 72 69 6e 74 20 66 6f | 72 6d 61 74 74 65 64 20 |Print fo|rmatted |
|00005310| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 61 62 6f 75 |informat|ion abou|
|00005320| 74 20 61 20 67 69 76 65 | 6e 20 74 69 6d 65 2e 7d |t a give|n time.}|
|00005330| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 74 69 6d 65 |..\funct|ion{time|
|00005340| 5c 5f 74 20 74 69 6d 65 | 28 74 69 6d 65 5c 5f 74 |\_t time|(time\_t|
|00005350| 20 5c 2a 74 29 3b 7d 0a | 5c 65 78 70 6c 7b 52 65 | \*t);}.|\expl{Re|
|00005360| 74 75 72 6e 20 74 69 6d | 65 20 69 6e 20 73 65 63 |turn tim|e in sec|
|00005370| 6f 6e 64 73 20 73 69 6e | 63 65 20 6d 69 64 6e 69 |onds sin|ce midni|
|00005380| 67 68 74 20 4a 61 6e 75 | 61 72 79 20 31 20 31 39 |ght Janu|ary 1 19|
|00005390| 37 30 2c 20 47 4d 54 2e | 7d 0a 0a 5c 66 75 6e 63 |70, GMT.|}..\func|
|000053a0| 74 69 6f 6e 7b 76 6f 69 | 64 20 74 7a 73 65 74 28 |tion{voi|d tzset(|
|000053b0| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 53 65 74 20 74 68 |);}.\exp|l{Set th|
|000053c0| 65 20 74 69 6d 65 7a 6f | 6e 65 20 61 6e 64 20 64 |e timezo|ne and d|
|000053d0| 73 74 20 66 6c 61 67 20 | 74 6f 20 74 68 65 20 6c |st flag |to the l|
|000053e0| 6f 63 61 6c 20 72 75 6c | 65 73 20 28 64 65 70 65 |ocal rul|es (depe|
|000053f0| 6e 64 69 6e 67 20 6f 6e | 0a 65 6e 76 69 72 6f 6e |nding on|.environ|
|00005400| 6d 65 6e 74 20 76 61 72 | 69 61 62 6c 65 20 60 60 |ment var|iable ``|
|00005410| 54 5a 27 27 29 2e 7d 0a | 0a 25 25 25 25 25 25 25 |TZ'').}.|.%%%%%%%|
|00005420| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005430| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005440| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005450| 25 25 25 25 25 0a 0c 0a | 5c 73 65 63 74 69 6f 6e |%%%%%...|\section|
|00005460| 7b 46 69 6c 65 20 61 6e | 64 20 44 69 72 65 63 74 |{File an|d Direct|
|00005470| 6f 72 79 20 49 6e 66 6f | 72 6d 61 74 69 6f 6e 7d |ory Info|rmation}|
|00005480| 0a 0a 5c 23 69 6e 63 6c | 75 64 65 20 5c 3c 73 74 |..\#incl|ude \<st|
|00005490| 61 74 2e 68 3e 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |at.h>..\|function|
|000054a0| 7b 69 6e 74 20 20 66 73 | 74 61 74 28 69 6e 74 20 |{int fs|tat(int |
|000054b0| 66 64 2c 20 73 74 72 75 | 63 74 20 73 74 61 74 20 |fd, stru|ct stat |
|000054c0| 5c 2a 69 6e 66 6f 29 3b | 7d 0a 5c 65 78 70 6c 7b |\*info);|}.\expl{|
|000054d0| 4f 62 74 61 69 6e 20 69 | 6e 66 6f 72 6d 61 74 69 |Obtain i|nformati|
|000054e0| 6f 6e 20 61 62 6f 75 74 | 20 66 69 6c 65 20 61 73 |on about| file as|
|000054f0| 73 6f 73 69 61 74 65 64 | 20 77 69 74 68 20 66 69 |sosiated| with fi|
|00005500| 6c 65 64 65 73 63 72 69 | 70 74 6f 72 20 7b 5c 73 |ledescri|ptor {\s|
|00005510| 6c 20 66 64 7d 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 |l fd}.}.|.\functi|
|00005520| 6f 6e 7b 69 6e 74 20 20 | 6c 73 74 61 74 28 63 6f |on{int |lstat(co|
|00005530| 6e 73 74 7e 63 68 61 72 | 20 5c 2a 66 6e 61 6d 65 |nst~char| \*fname|
|00005540| 2c 20 73 74 72 75 63 74 | 20 73 74 61 74 20 5c 2a |, struct| stat \*|
|00005550| 69 6e 66 6f 29 3b 7d 0a | 5c 65 78 70 6c 7b 4c 69 |info);}.|\expl{Li|
|00005560| 6b 65 20 7b 5c 73 6c 20 | 73 74 61 74 7d 20 62 75 |ke {\sl |stat} bu|
|00005570| 74 20 72 65 74 75 72 6e | 20 69 6e 66 6f 20 61 62 |t return| info ab|
|00005580| 6f 75 74 20 7b 5c 73 6c | 20 73 79 6d 62 6f 6c 69 |out {\sl| symboli|
|00005590| 63 20 6c 69 6e 6b 73 7d | 2e 7d 0a 0a 5c 66 75 6e |c links}|.}..\fun|
|000055a0| 63 74 69 6f 6e 7b 69 6e | 74 20 20 73 74 61 74 28 |ction{in|t stat(|
|000055b0| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 66 6e 61 |const~ch|ar \*fna|
|000055c0| 6d 65 2c 20 73 74 72 75 | 63 74 20 73 74 61 74 20 |me, stru|ct stat |
|000055d0| 5c 2a 69 6e 66 6f 29 3b | 7d 0a 5c 65 78 70 6c 7b |\*info);|}.\expl{|
|000055e0| 4f 62 74 61 69 6e 20 69 | 6e 66 6f 72 6d 61 74 69 |Obtain i|nformati|
|000055f0| 6f 6e 20 61 62 6f 75 74 | 20 66 69 6c 65 20 7b 5c |on about| file {\|
|00005600| 73 6c 20 66 6e 61 6d 65 | 7d 2e 7d 0a 5c 6d 65 64 |sl fname|}.}.\med|
|00005610| 73 6b 69 70 0a 5c 23 69 | 6e 63 6c 75 64 65 20 5c |skip.\#i|nclude \|
|00005620| 3c 64 69 72 65 6e 74 2e | 68 3e 0a 0a 5c 66 75 6e |<dirent.|h>..\fun|
|00005630| 63 74 69 6f 6e 7b 69 6e | 74 20 63 6c 6f 73 65 64 |ction{in|t closed|
|00005640| 69 72 28 44 49 52 20 5c | 2a 64 69 72 70 29 3b 7d |ir(DIR \|*dirp);}|
|00005650| 0a 5c 65 78 70 6c 7b 43 | 6c 6f 73 65 20 64 69 72 |.\expl{C|lose dir|
|00005660| 65 63 74 6f 72 79 20 61 | 73 73 6f 73 69 61 74 65 |ectory a|ssosiate|
|00005670| 64 20 77 69 74 68 20 7b | 5c 73 6c 20 64 69 72 70 |d with {|\sl dirp|
|00005680| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 44 |}.}..\fu|nction{D|
|00005690| 49 52 20 5c 2a 6f 70 65 | 6e 64 69 72 28 63 6f 6e |IR \*ope|ndir(con|
|000056a0| 73 74 7e 63 68 61 72 20 | 5c 2a 64 69 72 6e 61 6d |st~char |\*dirnam|
|000056b0| 65 29 3b 7d 0a 5c 65 78 | 70 6c 7b 4f 70 65 6e 20 |e);}.\ex|pl{Open |
|000056c0| 64 69 72 65 63 74 6f 72 | 79 20 7b 5c 73 6c 20 64 |director|y {\sl d|
|000056d0| 69 72 6e 61 6d 65 7d 20 | 66 6f 72 20 72 65 61 64 |irname} |for read|
|000056e0| 69 6e 67 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ing.}..\|function|
|000056f0| 7b 73 74 72 75 63 74 7e | 64 69 72 65 6e 74 20 5c |{struct~|dirent \|
|00005700| 2a 72 65 61 64 64 69 72 | 28 44 49 52 20 5c 2a 64 |*readdir|(DIR \*d|
|00005710| 69 72 70 29 3b 7d 0a 5c | 65 78 70 6c 7b 52 65 61 |irp);}.\|expl{Rea|
|00005720| 64 20 61 6e 20 65 6e 74 | 72 79 20 66 72 6f 6d 20 |d an ent|ry from |
|00005730| 64 69 72 65 63 74 6f 72 | 79 20 61 73 73 6f 73 69 |director|y assosi|
|00005740| 61 74 65 64 20 77 69 74 | 68 20 7b 5c 73 6c 20 64 |ated wit|h {\sl d|
|00005750| 69 72 70 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |irp}.}..|\functio|
|00005760| 6e 7b 76 6f 69 64 20 72 | 65 77 69 6e 64 64 69 72 |n{void r|ewinddir|
|00005770| 28 44 49 52 20 5c 2a 64 | 69 72 70 29 3b 7d 0a 5c |(DIR \*d|irp);}.\|
|00005780| 65 78 70 6c 7b 53 65 65 | 6b 20 74 6f 20 74 68 65 |expl{See|k to the|
|00005790| 20 62 65 67 69 6e 6e 69 | 6e 67 20 6f 66 20 64 69 | beginni|ng of di|
|000057a0| 72 65 63 74 6f 72 79 20 | 61 73 73 6f 73 69 61 74 |rectory |assosiat|
|000057b0| 65 64 20 77 69 74 68 20 | 7b 5c 73 6c 20 64 69 72 |ed with |{\sl dir|
|000057c0| 70 7d 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |p}.}..\f|unction{|
|000057d0| 76 6f 69 64 20 73 65 65 | 6b 64 69 72 28 44 49 52 |void see|kdir(DIR|
|000057e0| 20 5c 2a 64 69 72 70 2c | 20 6f 66 66 5c 5f 74 20 | \*dirp,| off\_t |
|000057f0| 6c 6f 63 29 3b 7d 0a 5c | 65 78 70 6c 7b 53 65 65 |loc);}.\|expl{See|
|00005800| 6b 20 74 6f 20 70 6f 73 | 69 74 69 6f 6e 20 7b 5c |k to pos|ition {\|
|00005810| 73 6c 20 6c 6f 63 7d 20 | 69 6e 20 74 68 65 20 64 |sl loc} |in the d|
|00005820| 69 72 65 63 74 6f 72 79 | 20 61 73 73 6f 73 69 61 |irectory| assosia|
|00005830| 74 65 64 20 77 69 74 68 | 20 7b 5c 73 6c 0a 64 69 |ted with| {\sl.di|
|00005840| 72 70 7d 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |rp}.}..\|function|
|00005850| 7b 6f 66 66 5c 5f 74 20 | 74 65 6c 6c 64 69 72 28 |{off\_t |telldir(|
|00005860| 44 49 52 20 5c 2a 64 69 | 72 70 29 3b 7d 0a 5c 65 |DIR \*di|rp);}.\e|
|00005870| 78 70 6c 7b 47 65 74 20 | 74 68 65 20 63 75 72 72 |xpl{Get |the curr|
|00005880| 65 6e 74 20 70 6f 73 69 | 74 69 6f 6e 20 69 6e 20 |ent posi|tion in |
|00005890| 64 69 72 65 63 74 6f 72 | 79 20 61 73 73 6f 73 69 |director|y assosi|
|000058a0| 61 74 65 64 20 77 69 74 | 68 20 7b 5c 73 6c 0a 64 |ated wit|h {\sl.d|
|000058b0| 69 72 70 7d 2e 7d 20 0a | 0a 5c 66 75 6e 63 74 69 |irp}.} .|.\functi|
|000058c0| 6f 6e 7b 69 6e 74 20 61 | 6c 70 68 61 73 6f 72 74 |on{int a|lphasort|
|000058d0| 28 73 74 72 75 63 74 7e | 64 69 72 65 6e 74 20 7b |(struct~|dirent {|
|000058e0| 5c 2a 5c 2a 7d 73 72 63 | 2c 20 73 74 72 75 63 74 |\*\*}src|, struct|
|000058f0| 7e 64 69 72 65 6e 74 20 | 7b 5c 2a 5c 2a 7d 64 73 |~dirent |{\*\*}ds|
|00005900| 74 29 3b 7d 0a 5c 65 78 | 70 6c 7b 7d 0a 0a 5c 6d |t);}.\ex|pl{}..\m|
|00005910| 65 64 73 6b 69 70 0a 5c | 23 69 6e 63 6c 75 64 65 |edskip.\|#include|
|00005920| 20 5c 3c 66 74 77 2e 68 | 3e 0a 0a 5c 66 75 6e 63 | \<ftw.h|>..\func|
|00005930| 74 69 6f 6e 7b 69 6e 74 | 20 66 74 77 28 63 68 61 |tion{int| ftw(cha|
|00005940| 72 20 5c 2a 70 61 74 68 | 2c 20 69 6e 74 20 28 5c |r \*path|, int (\|
|00005950| 2a 66 6e 29 28 29 2c 20 | 69 6e 74 20 70 61 72 61 |*fn)(), |int para|
|00005960| 6d 29 3b 7d 0a 5c 65 78 | 70 6c 7b 52 65 63 75 72 |m);}.\ex|pl{Recur|
|00005970| 73 69 76 65 6c 79 20 77 | 61 6c 6b 20 74 72 65 65 |sively w|alk tree|
|00005980| 20 72 6f 6f 74 65 64 20 | 61 74 20 7b 5c 73 6c 20 | rooted |at {\sl |
|00005990| 70 61 74 68 7d 20 61 70 | 70 6c 79 69 6e 67 20 66 |path} ap|plying f|
|000059a0| 75 6e 63 74 69 6f 6e 20 | 7b 5c 73 6c 20 66 6e 7d |unction |{\sl fn}|
|000059b0| 2e 7d 0a 0a 0a 25 25 25 | 25 25 25 25 25 25 25 25 |.}...%%%|%%%%%%%%|
|000059c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000059d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000059e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000059f0| 25 0a 0c 0a 5c 73 65 63 | 74 69 6f 6e 7b 52 65 67 |%...\sec|tion{Reg|
|00005a00| 75 6c 61 72 20 45 78 70 | 72 65 73 73 69 6f 6e 73 |ular Exp|ressions|
|00005a10| 7d 0a 0a 5c 23 69 6e 63 | 6c 75 64 65 20 5c 3c 72 |}..\#inc|lude \<r|
|00005a20| 65 67 65 78 70 2e 68 3e | 0a 0a 5c 66 75 6e 63 74 |egexp.h>|..\funct|
|00005a30| 69 6f 6e 7b 72 65 67 65 | 78 70 20 5c 2a 72 65 67 |ion{rege|xp \*reg|
|00005a40| 63 6f 6d 70 28 63 68 61 | 72 20 5c 2a 65 78 70 29 |comp(cha|r \*exp)|
|00005a50| 3b 7d 0a 5c 65 78 70 6c | 7b 43 6f 6d 70 69 6c 65 |;}.\expl|{Compile|
|00005a60| 20 61 20 72 65 67 75 6c | 61 72 20 65 78 70 72 65 | a regul|ar expre|
|00005a70| 73 73 69 6f 6e 20 69 6e | 74 6f 20 61 6e 20 69 6e |ssion in|to an in|
|00005a80| 74 65 72 6e 61 6c 20 63 | 6f 64 65 2e 7d 0a 0a 5c |ternal c|ode.}..\|
|00005a90| 66 75 6e 63 74 69 6f 6e | 7b 69 6e 74 20 72 65 67 |function|{int reg|
|00005aa0| 65 78 65 63 28 72 65 67 | 65 78 70 20 5c 2a 70 72 |exec(reg|exp \*pr|
|00005ab0| 6f 67 2c 20 63 68 61 72 | 20 5c 2a 73 74 72 69 6e |og, char| \*strin|
|00005ac0| 67 2c 20 69 6e 74 20 62 | 6f 6c 66 6c 61 67 29 3b |g, int b|olflag);|
|00005ad0| 7d 0a 5c 65 78 70 6c 7b | 4d 61 74 63 68 20 74 68 |}.\expl{|Match th|
|00005ae0| 65 20 70 72 65 76 69 6f | 75 73 6c 79 20 63 6f 6d |e previo|usly com|
|00005af0| 70 69 6c 65 64 20 65 78 | 70 72 65 73 73 69 6f 6e |piled ex|pression|
|00005b00| 20 7b 5c 73 6c 20 70 72 | 6f 67 7d 20 61 67 61 69 | {\sl pr|og} agai|
|00005b10| 6e 73 74 20 74 68 65 0a | 7b 5c 73 6c 20 73 74 72 |nst the.|{\sl str|
|00005b20| 69 6e 67 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |ing}.}..|\functio|
|00005b30| 6e 7b 76 6f 69 64 20 72 | 65 67 73 75 62 28 72 65 |n{void r|egsub(re|
|00005b40| 67 65 78 70 20 5c 2a 70 | 72 6f 67 2c 20 63 68 61 |gexp \*p|rog, cha|
|00005b50| 72 20 5c 2a 73 6f 75 72 | 63 65 2c 20 63 68 61 72 |r \*sour|ce, char|
|00005b60| 20 5c 2a 64 65 73 74 29 | 3b 7d 0a 5c 65 78 70 6c | \*dest)|;}.\expl|
|00005b70| 7b 53 75 62 73 74 69 74 | 75 74 65 20 74 68 65 20 |{Substit|ute the |
|00005b80| 70 72 65 76 69 6f 75 73 | 6c 79 20 6d 61 74 63 68 |previous|ly match|
|00005b90| 65 64 20 65 78 70 72 65 | 73 73 69 6f 6e 20 7b 5c |ed expre|ssion {\|
|00005ba0| 73 6c 20 70 72 6f 67 7d | 20 77 69 74 68 0a 7b 5c |sl prog}| with.{\|
|00005bb0| 73 6c 20 73 6f 75 72 63 | 65 7d 2e 20 54 68 65 20 |sl sourc|e}. The |
|00005bc0| 72 65 73 75 6c 74 20 69 | 73 20 63 6f 70 69 65 64 |result i|s copied|
|00005bd0| 20 74 6f 20 7b 5c 73 6c | 20 64 65 73 74 7d 2e 7d | to {\sl| dest}.}|
|00005be0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 76 6f 69 64 |..\funct|ion{void|
|00005bf0| 20 72 65 67 64 75 6d 70 | 28 72 65 67 65 78 70 20 | regdump|(regexp |
|00005c00| 5c 2a 72 29 3b 7d 0a 5c | 65 78 70 6c 7b 44 75 6d |\*r);}.\|expl{Dum|
|00005c10| 70 20 74 68 65 20 72 65 | 67 75 6c 61 72 20 65 78 |p the re|gular ex|
|00005c20| 70 72 65 73 73 69 6f 6e | 20 7b 5c 73 6c 20 72 7d |pression| {\sl r}|
|00005c30| 20 6f 6e 74 6f 20 5c 3c | 73 74 64 6f 75 74 3e 20 | onto \<|stdout> |
|00005c40| 69 6e 20 76 61 67 75 65 | 6c 79 0a 63 6f 6d 70 72 |in vague|ly.compr|
|00005c50| 65 68 65 6e 73 69 62 6c | 65 20 66 6f 72 6d 2e 7d |ehensibl|e form.}|
|00005c60| 0a 0a 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |..%%%%%%|%%%%%%%%|
|00005c70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005c80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005c90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 0a 0c |%%%%%%%%|%%%%%%..|
|00005ca0| 0a 5c 73 65 63 74 69 6f | 6e 7b 53 65 74 6a 6d 70 |.\sectio|n{Setjmp|
|00005cb0| 20 5c 26 20 53 69 67 6e | 61 6c 20 53 74 75 66 66 | \& Sign|al Stuff|
|00005cc0| 7d 0a 0a 5c 23 69 6e 63 | 6c 75 64 65 20 5c 3c 73 |}..\#inc|lude \<s|
|00005cd0| 65 74 6a 6d 70 2e 68 3e | 0a 0a 5c 66 75 6e 63 74 |etjmp.h>|..\funct|
|00005ce0| 69 6f 6e 7b 69 6e 74 20 | 73 65 74 6a 6d 70 28 6a |ion{int |setjmp(j|
|00005cf0| 6d 70 5c 5f 62 75 66 20 | 62 75 66 29 3b 7d 0a 5c |mp\_buf |buf);}.\|
|00005d00| 65 78 70 6c 7b 50 72 65 | 70 61 72 65 20 62 75 66 |expl{Pre|pare buf|
|00005d10| 66 65 72 20 7b 5c 73 6c | 20 62 75 66 7d 20 66 6f |fer {\sl| buf} fo|
|00005d20| 72 20 6e 6f 6e 20 6c 6f | 63 61 6c 20 67 6f 74 6f |r non lo|cal goto|
|00005d30| 20 76 69 61 20 7b 5c 62 | 66 20 6c 6f 6e 67 6a 6d | via {\b|f longjm|
|00005d40| 70 7d 28 29 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |p}().}..|\functio|
|00005d50| 6e 7b 76 6f 69 64 20 6c | 6f 6e 67 6a 6d 70 28 6a |n{void l|ongjmp(j|
|00005d60| 6d 70 5c 5f 62 75 66 20 | 62 75 66 2c 20 69 6e 74 |mp\_buf |buf, int|
|00005d70| 20 72 76 29 3b 7d 0a 5c | 65 78 70 6c 7b 52 65 74 | rv);}.\|expl{Ret|
|00005d80| 75 72 6e 20 74 6f 20 70 | 72 65 76 69 6f 75 73 6c |urn to p|reviousl|
|00005d90| 79 20 73 61 76 65 64 20 | 63 6f 6e 74 65 78 74 20 |y saved |context |
|00005da0| 7b 5c 73 6c 20 62 75 66 | 7d 20 77 69 74 68 20 72 |{\sl buf|} with r|
|00005db0| 65 74 75 72 6e 20 76 61 | 6c 75 65 0a 7b 5c 73 6c |eturn va|lue.{\sl|
|00005dc0| 20 72 76 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f | rv}.}..|\functio|
|00005dd0| 6e 7b 69 6e 74 20 63 61 | 74 63 68 28 6a 6d 70 5c |n{int ca|tch(jmp\|
|00005de0| 5f 62 75 66 20 69 64 2c | 20 69 6e 74 20 28 2a 66 |_buf id,| int (*f|
|00005df0| 6e 29 28 76 6f 69 64 29 | 29 3b 7d 0a 5c 65 78 70 |n)(void)|);}.\exp|
|00005e00| 6c 7b 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 76 |l{}..\fu|nction{v|
|00005e10| 6f 69 64 20 74 68 72 6f | 77 28 6a 6d 70 5c 5f 62 |oid thro|w(jmp\_b|
|00005e20| 75 66 20 69 64 2c 20 69 | 6e 74 20 72 76 29 3b 7d |uf id, i|nt rv);}|
|00005e30| 0a 5c 65 78 70 6c 7b 7d | 0a 5c 6d 65 64 73 6b 69 |.\expl{}|.\medski|
|00005e40| 70 0a 0a 5c 23 69 6e 63 | 6c 75 64 65 20 5c 3c 73 |p..\#inc|lude \<s|
|00005e50| 69 67 6e 61 6c 2e 68 3e | 0a 0a 5c 66 75 6e 63 74 |ignal.h>|..\funct|
|00005e60| 69 6f 6e 7b 7b 5c 5f 5c | 5f 53 69 67 66 75 6e 63 |ion{{\_\|_Sigfunc|
|00005e70| 7d 20 73 69 67 6e 61 6c | 28 69 6e 74 20 73 69 67 |} signal|(int sig|
|00005e80| 2c 20 5c 5f 5c 5f 53 69 | 67 66 75 6e 63 20 66 75 |, \_\_Si|gfunc fu|
|00005e90| 6e 63 29 3b 7d 0a 5c 65 | 78 70 6c 7b 49 6e 73 74 |nc);}.\e|xpl{Inst|
|00005ea0| 61 6c 6c 20 74 68 65 20 | 68 61 6e 64 6c 65 72 20 |all the |handler |
|00005eb0| 7b 5c 73 6c 20 66 75 6e | 63 7d 20 66 6f 72 20 73 |{\sl fun|c} for s|
|00005ec0| 69 67 6e 61 6c 20 7b 5c | 73 6c 20 73 69 67 7d 2e |ignal {\|sl sig}.|
|00005ed0| 7d 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 69 6e 74 |}..\func|tion{int|
|00005ee0| 20 72 61 69 73 65 28 69 | 6e 74 20 73 69 67 29 3b | raise(i|nt sig);|
|00005ef0| 7d 0a 5c 65 78 70 6c 7b | 7d 0a 0a 5c 66 75 6e 63 |}.\expl{|}..\func|
|00005f00| 74 69 6f 6e 7b 6c 6f 6e | 67 20 73 69 67 73 65 74 |tion{lon|g sigset|
|00005f10| 6d 61 73 6b 28 6c 6f 6e | 67 20 6d 61 73 6b 29 3b |mask(lon|g mask);|
|00005f20| 7d 0a 5c 65 78 70 6c 7b | 28 4d 69 4e 54 29 7d 0a |}.\expl{|(MiNT)}.|
|00005f30| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 6c 6f 6e 67 20 |.\functi|on{long |
|00005f40| 73 69 67 62 6c 6f 63 6b | 28 6c 6f 6e 67 20 6d 61 |sigblock|(long ma|
|00005f50| 73 6b 29 3b 7d 0a 5c 65 | 78 70 6c 7b 28 4d 69 4e |sk);}.\e|xpl{(MiN|
|00005f60| 54 29 7d 0a 0a 25 25 25 | 25 25 25 25 25 25 25 25 |T)}..%%%|%%%%%%%%|
|00005f70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005f80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005f90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005fa0| 25 0a 0c 0a 5c 73 65 63 | 74 69 6f 6e 7b 55 2a 49 |%...\sec|tion{U*I|
|00005fb0| 58 20 43 6f 6d 70 61 74 | 69 62 69 6c 69 74 79 20 |X Compat|ibility |
|00005fc0| 52 6f 75 74 69 6e 65 73 | 7d 0a 0a 5c 23 69 6e 63 |Routines|}..\#inc|
|00005fd0| 6c 75 64 65 20 5c 3c 75 | 6e 69 73 74 64 2e 68 3e |lude \<u|nistd.h>|
|00005fe0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 76 6f 69 64 |..\funct|ion{void|
|00005ff0| 20 5c 5f 65 78 69 74 28 | 69 6e 74 20 72 65 74 29 | \_exit(|int ret)|
|00006000| 3b 7d 0a 5c 65 78 70 6c | 7b 45 78 69 74 20 74 68 |;}.\expl|{Exit th|
|00006010| 65 20 63 75 72 72 65 6e | 74 20 70 72 6f 63 65 73 |e curren|t proces|
|00006020| 73 20 77 69 74 68 6f 75 | 74 20 63 6c 65 61 6e 69 |s withou|t cleani|
|00006030| 6e 67 20 75 70 2e 20 28 | 54 68 69 73 20 69 73 20 |ng up. (|This is |
|00006040| 61 20 7b 5c 62 66 0a 50 | 74 65 72 6d 28 29 7d 29 |a {\bf.P|term()})|
|00006050| 7d 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 69 6e 74 |}..\func|tion{int|
|00006060| 20 61 63 63 65 73 73 28 | 63 6f 6e 73 74 7e 63 68 | access(|const~ch|
|00006070| 61 72 20 5c 2a 66 6e 61 | 6d 65 2c 20 69 6e 74 20 |ar \*fna|me, int |
|00006080| 6d 6f 64 65 29 3b 7d 0a | 5c 65 78 70 6c 7b 43 68 |mode);}.|\expl{Ch|
|00006090| 65 63 6b 2c 20 69 66 20 | 66 69 6c 65 20 7b 5c 73 |eck, if |file {\s|
|000060a0| 6c 20 66 6e 61 6d 65 7d | 20 69 73 20 61 63 63 65 |l fname}| is acce|
|000060b0| 73 73 61 62 6c 65 20 77 | 69 74 68 20 6d 6f 64 65 |ssable w|ith mode|
|000060c0| 20 7b 5c 73 6c 20 6d 6f | 64 65 7d 2e 7d 0a 0a 5c | {\sl mo|de}.}..\|
|000060d0| 66 75 6e 63 74 69 6f 6e | 7b 75 6e 73 69 67 6e 65 |function|{unsigne|
|000060e0| 64 7e 69 6e 74 20 61 6c | 61 72 6d 28 75 6e 73 69 |d~int al|arm(unsi|
|000060f0| 67 6e 65 64 7e 69 6e 74 | 20 73 65 63 29 3b 7d 0a |gned~int| sec);}.|
|00006100| 5c 65 78 70 6c 7b 49 6e | 73 74 72 75 63 74 73 20 |\expl{In|structs |
|00006110| 74 68 65 20 61 6c 61 72 | 6d 20 63 6c 6f 63 6b 20 |the alar|m clock |
|00006120| 6f 66 20 74 68 65 20 63 | 61 6c 6c 69 6e 67 20 70 |of the c|alling p|
|00006130| 72 6f 63 65 73 73 20 74 | 6f 20 73 65 6e 64 20 74 |rocess t|o send t|
|00006140| 68 65 20 73 69 67 6e 61 | 6c 0a 20 20 20 20 20 20 |he signa|l. |
|00006150| 53 49 47 41 4c 52 4d 20 | 74 6f 20 74 68 65 20 63 |SIGALRM |to the c|
|00006160| 61 6c 6c 69 6e 67 20 70 | 72 6f 63 65 73 73 20 61 |alling p|rocess a|
|00006170| 66 74 65 72 20 7b 5c 73 | 6c 20 73 65 63 7d 20 73 |fter {\s|l sec} s|
|00006180| 65 63 6f 6e 64 73 7d 0a | 0a 5c 66 75 6e 63 74 69 |econds}.|.\functi|
|00006190| 6f 6e 7b 69 6e 74 20 63 | 68 64 69 72 28 63 6f 6e |on{int c|hdir(con|
|000061a0| 73 74 7e 63 68 61 72 20 | 5c 2a 64 6e 61 6d 65 29 |st~char |\*dname)|
|000061b0| 3b 7d 0a 5c 65 78 70 6c | 7b 43 68 61 6e 65 20 74 |;}.\expl|{Chane t|
|000061c0| 68 65 20 63 75 72 72 65 | 6e 74 20 77 6f 72 6b 69 |he curre|nt worki|
|000061d0| 6e 67 20 64 69 72 65 63 | 74 6f 72 79 20 74 6f 20 |ng direc|tory to |
|000061e0| 7b 5c 73 6c 20 64 6e 61 | 6d 65 7d 20 69 6e 63 6c |{\sl dna|me} incl|
|000061f0| 75 64 69 6e 67 20 64 72 | 69 76 65 0a 73 70 65 63 |uding dr|ive.spec|
|00006200| 69 66 69 63 61 74 69 6f | 6e 2e 7d 0a 0a 5c 66 75 |ificatio|n.}..\fu|
|00006210| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 63 68 6d 6f 64 |nction{i|nt chmod|
|00006220| 28 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 66 6e |(const~c|har \*fn|
|00006230| 61 6d 65 2c 20 69 6e 74 | 20 6d 6f 64 65 29 3b 7d |ame, int| mode);}|
|00006240| 0a 5c 65 78 70 6c 7b 43 | 68 61 6e 67 65 20 70 65 |.\expl{C|hange pe|
|00006250| 72 6d 69 73 73 69 6f 6e | 73 20 6f 66 20 66 69 6c |rmission|s of fil|
|00006260| 65 20 7b 5c 73 6c 20 66 | 6e 61 6d 65 7d 20 74 6f |e {\sl f|name} to|
|00006270| 20 7b 5c 73 6c 20 6d 6f | 64 65 7d 2e 7d 0a 0a 5c | {\sl mo|de}.}..\|
|00006280| 66 75 6e 63 74 69 6f 6e | 7b 69 6e 74 20 63 68 6f |function|{int cho|
|00006290| 77 6e 28 63 6f 6e 73 74 | 7e 63 68 61 72 20 5c 2a |wn(const|~char \*|
|000062a0| 66 6e 61 6d 65 2c 20 69 | 6e 74 20 75 69 64 2c 20 |fname, i|nt uid, |
|000062b0| 69 6e 74 20 67 69 64 29 | 3b 7d 0a 5c 65 78 70 6c |int gid)|;}.\expl|
|000062c0| 7b 43 68 61 6e 67 65 20 | 6f 77 6e 65 72 20 61 6e |{Change |owner an|
|000062d0| 64 20 67 72 6f 75 70 20 | 6f 66 20 66 69 6c 65 20 |d group |of file |
|000062e0| 7b 5c 73 6c 20 66 6e 61 | 6d 65 7d 2e 20 28 46 61 |{\sl fna|me}. (Fa|
|000062f0| 6b 65 20 66 6f 72 20 6e | 6f 77 29 7d 0a 0a 5c 66 |ke for n|ow)}..\f|
|00006300| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 63 6c 6f 73 |unction{|int clos|
|00006310| 65 28 69 6e 74 20 66 64 | 29 3b 7d 0a 5c 65 78 70 |e(int fd|);}.\exp|
|00006320| 6c 7b 43 6c 6f 73 65 20 | 74 68 65 20 66 69 6c 65 |l{Close |the file|
|00006330| 20 61 73 73 6f 73 69 61 | 74 65 64 20 77 69 74 68 | assosia|ted with|
|00006340| 20 66 69 6c 65 20 64 65 | 73 63 72 69 70 74 6f 72 | file de|scriptor|
|00006350| 20 7b 5c 73 6c 20 66 64 | 7d 2e 7d 0a 0a 5c 66 75 | {\sl fd|}.}..\fu|
|00006360| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 63 72 65 61 74 |nction{i|nt creat|
|00006370| 28 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 66 6e |(const~c|har \*fn|
|00006380| 61 6d 65 2c 20 75 6e 73 | 69 67 6e 65 64 20 6d 6f |ame, uns|igned mo|
|00006390| 64 65 29 3b 7d 0a 5c 65 | 78 70 6c 7b 43 72 65 61 |de);}.\e|xpl{Crea|
|000063a0| 74 65 20 74 68 65 20 66 | 69 6c 65 20 7b 5c 73 6c |te the f|ile {\sl|
|000063b0| 20 66 6e 61 6d 65 7d 20 | 77 69 74 68 20 6d 6f 64 | fname} |with mod|
|000063c0| 65 20 7b 5c 73 6c 20 6d | 6f 64 65 7d 2e 7d 0a 0a |e {\sl m|ode}.}..|
|000063d0| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 64 75 |\functio|n{int du|
|000063e0| 70 28 69 6e 74 20 66 64 | 29 3b 7d 0a 5c 65 78 70 |p(int fd|);}.\exp|
|000063f0| 6c 7b 44 75 70 6c 69 63 | 61 74 65 20 66 69 6c 65 |l{Duplic|ate file|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.